Author |
Message |
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 31 Jan 2008 03:46:12 pm Post subject: |
|
|
I was so close!
I thought I had the high score fixed. I went to the TI-Basic Developer site and looked on the section marked, guess what, Highscores. It walked me through the process, but now when I try to open up the High Score option from the Safe House, it presents and ERROR:ARGUMENT. Here's the code:
Lbl M6
Disp "High Score:",∟THIEF(1," ","Your Score:",M
Pause
Goto M0
What did I do wrong?
Also, here's a copy of the most updated game, because I've been toying with it, just trying out new things.
[attachment=2157:attachment] |
|
Back to top |
|
|
JoostinOnline
Active Member
Joined: 22 Aug 2007 Posts: 559
|
Posted: 31 Jan 2008 05:16:51 pm Post subject: |
|
|
Your problem lies here:
Disp "High Score:",∟THIEF(1," ","Your Score:",M
You forgot to close the parenthesis, making "", "Your Score:" and M arguments of the (1) function. Your code should be:
Disp "High Score:",∟THIEF(1)," ","Your Score:",M
Btw, to get the blue text that we are using for code, do this:
[ goose ]code[/ goose ] except without the spaces.
Last edited by Guest on 04 Aug 2010 01:42:00 pm; edited 1 time in total |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 31 Jan 2008 08:18:37 pm Post subject: |
|
|
thanks, I had been wondering about the blue. spent 10 minutes trying to hack it out before I gave up. |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 03 Feb 2008 03:22:54 pm Post subject: |
|
|
Finished.
A copy of the completed program for free distribution. (I got it off of the internet as freeware, so it's totally legal to take one.
[attachment=2170:attachment]
Ideas for this game are always welcome, if you want to PM me or post it here, it doesn't matter. I would like to post a 1.1 or even 2.0 on the site I got it from simply to show what we do here.
Last edited by Guest on 03 Feb 2008 03:27:27 pm; edited 1 time in total |
|
Back to top |
|
|
luby I want to go back to Philmont!!
Calc Guru
Joined: 23 Apr 2006 Posts: 1477
|
Posted: 03 Feb 2008 05:40:59 pm Post subject: |
|
|
Well, when I ran it, I got a DATATYPE error because THIEF didn't have anything in it. Try a 1→dim(LTHIEF after the SetupEditor |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 07 Feb 2008 06:13:22 pm Post subject: |
|
|
hmm... strange...
I put it in, but changed it to 2→dim(LTHIEF to account for the sin( security system I put in.
I was thinking of changing the doctor to just heal as much as you have money for, instead of healing you full if you have enough money for it, and sending you away if you don't have enough for a full heal, can somebody rail off the code for me?
Last edited by Guest on 04 Aug 2010 01:42:28 pm; edited 1 time in total |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 07 Feb 2008 06:14:43 pm Post subject: |
|
|
For the sin( security system: If you do that, make sure to add a degree or radian symbol with the sin( command. Otherwise you'll be resetting the score every time the user changes Degree or Radian mode.
Last edited by Guest on 07 Feb 2008 06:39:54 pm; edited 1 time in total |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 07 Feb 2008 06:30:10 pm Post subject: |
|
|
:confused:
big words...
Here's what I got for the more helpful doctor:
Menu("DOCTOR","GET HEALED",GH,"BACK",M0)
Lbl GH
2000(10-H)→V
If M-V≥0
Then
10→H
M-V→M
End
If M<V
Then
(M/2000)-.5→Z:round(Z,0)→Z
H+Z→H
M-(2000Z)→M
End
Last edited by Guest on 04 Aug 2010 01:42:50 pm; edited 1 time in total |
|
Back to top |
|
|
JoostinOnline
Active Member
Joined: 22 Aug 2007 Posts: 559
|
Posted: 07 Feb 2008 06:36:19 pm Post subject: |
|
|
Just a few optimizations:
Menu("DOCTOR","GET HEALED",GH,"BACK",M0
Lbl GH
2000(10-H→V
If M-V≥0
Then
10→H
M-V→M
Else
M/2000-.5→Z:int(Z→Z
H+Z→H
M-2000Z→M
End
Last edited by Guest on 04 Aug 2010 01:43:07 pm; edited 1 time in total |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 07 Feb 2008 08:01:54 pm Post subject: |
|
|
Menu("DOCTOR","GET HEALED",GH,"BACK",M0
Lbl GH
2[font="verdana"]E3(10-H→V
If M≥Ans
Then
M-Ans→M
10→H
Else
round(.5([font="verdana"]E‾3M-1),0→Z
H+Ans→H
M-2[font="verdana"]E3Z→M
End
Last edited by Guest on 04 Aug 2010 01:44:37 pm; edited 1 time in total |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 11 Feb 2008 10:29:48 pm Post subject: |
|
|
Weregoose wrote: Menu("DOCTOR","GET HEALED",GH,"BACK",M0
Lbl GH
2[font="verdana"]E3(10-H→V
If M≥Ans
Then
M-Ans→M
10→H
Else
round(.5([font="verdana"]E‾3M-1),0→Z
H+Ans→H
M-2[font="verdana"]E3Z→M
End
[post="120108"]<{POST_SNAPBACK}>[/post]
Goose, if you are just going to use Ans for the cost of the doctor, why are you storing it in V? And second, I like to hesitate when using the Ans command for this reason: it is very easily erased. I prefer to store it in a temporary variable, a "background variable" if you will, one that is used purely for mathematical purposes, in this case, V.
Last edited by Guest on 04 Aug 2010 01:49:00 pm; edited 1 time in total |
|
Back to top |
|
|
TheStorm
Calc Guru
Joined: 17 Apr 2007 Posts: 1233
|
Posted: 11 Feb 2008 10:55:54 pm Post subject: |
|
|
He stored it v encase you need it later but the ans form will be faster. |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 11 Feb 2008 11:10:22 pm Post subject: |
|
|
I assumed that it was needed later on. Looking at the .8xp here just now, I've changed my mind.
You are free to take the V out, stranger, but that'd require putting some hesitation aside.
Last edited by Guest on 04 Aug 2010 01:49:27 pm; edited 1 time in total |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 11 Feb 2008 11:25:15 pm Post subject: |
|
|
How about replacing the entire code with this?
Lbl GH
While M≥2E3 and H<10
H+1→H
M-2E3→M
End
Sure this is suboptimal in terms of speed, but it's going to be fast enough to be unnoticeable either way (at most 9 iterations here).
Last edited by Guest on 04 Aug 2010 01:50:06 pm; edited 1 time in total |
|
Back to top |
|
|
alexrudd pm me if you read this
Bandwidth Hog
Joined: 06 Oct 2004 Posts: 2335
|
Posted: 12 Feb 2008 10:23:55 am Post subject: |
|
|
If H is always an integer, which appears to be the case:
[s]If H < 10[/s] If H <=9
Last edited by Guest on 04 Aug 2010 01:50:30 pm; edited 1 time in total |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 13 Feb 2008 07:40:10 pm Post subject: |
|
|
alexrudd wrote: If H is always an integer, which appears to be the case:
[s]If H < 10[/s] If H <=9
[post="120248"]<{POST_SNAPBACK}>[/post]
:confused: Just checking, "H <=9" means 9≥H right?
Second, totally unrelated to Atheif, I'm also working on a guess-my-number kind of game. I have a version that asks you to guess the calc's number, this is the one where it guesses your number. The code is as follows:
ClrHome
Output(2,4,"THINK OF A NUMBER BETWEEN 1 AND 100.
Output(6,1,"PRESS ENTER WHEN YOU'RE READY...
Pause
50→G:0→C:6→L:-1→A
ClrHome
While A≠0 and L≠0
ClrHome
Repeat 1<G and G<100
G-3→X:G+3→Y
randInt(X,Y)→G
abs(int(G/2))→C
C-3→X:C+3→Y
randInt(X,Y)→C:abs(int(C→C
-1→A
If (G+C)-3>100 or (G-C)+3<1
Then
Disp " "," "," "," "," "," "," "
Output(3,1,"---------------- CHEATER! I WIN!----------------
Output(1,1,"
Stop
End
End
Disp "0 FOR CORRECT","1 FOR TOO BIG","2 FOR TOO SMALL","GUESSES LEFT:","MY GUESS:"
Output(4,14,L
Output(5,10,G
While A≠0 and A≠1 and A≠2
Input A
End
If A=1
Then
G-C→G
L-1→L
End
If A=2
Then
G+C→G
L-1→L
End
If A=0
Disp "I WIN!
If L=0
Disp "YOU WIN!
End
Output(1,1,"
Sometimes it goes straight to the "CHEATER! I WIN!" screen, and the numbers sometimes go over 100 or under 1, it's weird because it only happens sporadically, and we all know that machines are never random...
Last edited by Guest on 04 Aug 2010 01:41:29 pm; edited 1 time in total |
|
Back to top |
|
|
alexrudd pm me if you read this
Bandwidth Hog
Joined: 06 Oct 2004 Posts: 2335
|
Posted: 13 Feb 2008 07:42:42 pm Post subject: |
|
|
stranger wrote: :confused: Just checking, "H <=9" means 9≥H right? [post="120293"]<{POST_SNAPBACK}>[/post] Yep, I was just lazy typing it and didn't want to go find the symbol. |
|
Back to top |
|
|
|