Author |
Message |
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 23 Jan 2008 08:37:09 pm Post subject: |
|
|
HELP!!!!!!!
I have a program that I got off of the Web. I made a small addition to it (namely, a high-score feature), but I have found problems with it:
1. The "Doctor" heals if you have the money, but doesn't take the "pay".
2. The high score feature notes that a score is the high, but doesn't save it...
If anybody can solve these problems, please do. Let's just say that it is my and my friend's one source of relaxation during English.
[attachment=2141:attachment]
Not to discourage anyone, if you have ideas relating to the game and how it could be improved, despite the creator's e-mail address on the "game info" screen, it is not copyrighted, and if I can get enough improvements off of bringing it here, I might post a v1.1 or something on the site.
Last edited by Guest on 23 Jan 2008 11:20:33 pm; edited 1 time in total |
|
Back to top |
|
|
JoostinOnline
Active Member
Joined: 22 Aug 2007 Posts: 559
|
Posted: 23 Jan 2008 08:44:33 pm Post subject: |
|
|
stranger wrote: HELP!!!!!!!
[post="119329"]<{POST_SNAPBACK}>[/post]
You just screamed "n00b alert!" with that . I will try to see if I can find the problem, and welcome to UTI |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 23 Jan 2008 08:56:00 pm Post subject: |
|
|
To fix the first problem:
find the doctor's menu in the code. It looks like:
Code: :Menu("DOCTOR","GET HEALED",GH,"BACK",M0)
:Lbl GH
:If M≥2000(10-H)
:Then
:10→H
:If M≥2000(10-H)
:M-((10-H)2000)→M
:End
:If M<2000(10-H)
:Goto NM
:Goto M0
Change this section to:
Code: :Menu("DOCTOR","GET HEALED",GH,"BACK",M0)
:Lbl GH
:2000(10-H
:If M<Ans
:Goto NM
:M-Ans→M
:10→H
:Goto M0
As for the high scores, the game does save it, but to the very insecure location of the variable θ. Here is one way to fix it, which will use the list ∟THIEF instead.
Add this code to the beginning of the program, right after ::"AThief v1.0 -
Code: :SetUpEditor THIEF
:SetUpEditor
:If not(dim(∟THIEF
:{0→THIEF
:∟THIEF(1→θ
Add this code to the end of the program, right before Stop (the Stop is actually unnecessary, you can get rid of it):
Code: :{θ→THIEF
A guide to finding the commands I used:
Lbl - press PRGM, 9
Goto - Press PRGM, 0
< - press 2nd, MATH, 5
SetUpEditor - press STAT, 5
not( - press 2nd, MATH, RIGHT, 4
dim( - press 2nd, STAT, RIGHT, 3
∟ - press 2nd, STAT, RIGHT, ALPHA, APPS
Also, a tip: replace the final bit of code with lots of convoluted If statements whose logic doesn't work out right anyway with this (e is the 2nd EE command):
Code: :sum(M>{2,3,5,8,10,20,30,50}e4→S
:If not(S
:Disp "THAT SUCKED BIG
:If S=1
:Disp "ROB SOMETHING","OTHER THAN THE","MINI MART
:If S=2
:Disp "PRESS MORE THAN","ONE KEY
:If S=3 or U≥10
:Disp "YOU BOUGHT TOO","MANY UZIs
:If S=4
:Disp "ROB GATES MORE","OFTEN
:If S=5
:Disp "COULDN'T DO","BETTER MYSELF
:If S=6
:Disp "YOU CHEATED
:Pause
Last edited by Guest on 23 Jan 2008 10:29:33 pm; edited 1 time in total |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 23 Jan 2008 10:31:38 pm Post subject: |
|
|
DarkerLine wrote: Also, a tip: replace the final bit of code with lots of convoluted If statements whose logic doesn't work out right anyway with this (e is the 2nd EE command):
Code: :sum(M>{2e4,3e4,5e4,8e4,e5,2e5,3e5,5e5→S
:If not(S
:Disp "THAT SUCKED BIG
:If S=1
:Disp "ROB SOMETHING","OTHER THAN THE","MINI MART
:If S=2
:Disp "PRESS MORE THAN","ONE KEY
:If S=3 or U≥10
:Disp "YOU BOUGHT TOO","MANY UZIs
:If S=4
:Disp "ROB GATES MORE","OFTEN
:If S=5
:Disp "COULDN'T DO","BETTER MYSELF
:If S=6
:Disp "YOU CHEATED
:Pause
[post="119333"]<{POST_SNAPBACK}>[/post]
Where exactly does this start? Lbl TU? After?
Also, to JoostinOnline, noob though it may make me, I started programming in October, and I'm teaching myself from other people's programs. :biggrin: |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 23 Jan 2008 10:47:32 pm Post subject: |
|
|
Just after the code
Code: :If M>θ
:M→θ
|
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 23 Jan 2008 11:12:21 pm Post subject: |
|
|
Yea, but S is already used for your Skill, or is this OK? :confused:
It probably is, seeing as all variables are interchangeable.
Last edited by Guest on 23 Jan 2008 11:13:22 pm; edited 1 time in total |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 28 Jan 2008 02:19:01 pm Post subject: |
|
|
i'm having trouble with the high score feature. The Doctor is totally fixed, but for some reason the calculator is having trouble moving the variable M to list THIEF. I was toying around with it and here's what I got:
Code: :SetUpEditor THIEF
:If not(dim(∟THIEF
:{Z→∟THIEF
...
:If M>Z
:Disp "NEW HIGH SCORE!"
:If M>Z
:M→Z
...
:{Z→∟THIEF
Where have I gone wrong, and what does the If not(dim( mean? :confused: |
|
Back to top |
|
|
luby I want to go back to Philmont!!
Calc Guru
Joined: 23 Apr 2006 Posts: 1477
|
Posted: 28 Jan 2008 04:37:10 pm Post subject: |
|
|
That means if the list has a dim of 0(i.e. it doesn't exist) it will store list Z to the thief list. |
|
Back to top |
|
|
pugboy
Active Member
Joined: 11 Apr 2007 Posts: 544
|
Posted: 28 Jan 2008 08:38:26 pm Post subject: |
|
|
How about
If M>Z
{M→∟THIEF
Last edited by Guest on 30 Aug 2010 08:09:20 pm; edited 1 time in total |
|
Back to top |
|
|
JoostinOnline
Active Member
Joined: 22 Aug 2007 Posts: 559
|
Posted: 29 Jan 2008 11:29:50 pm Post subject: |
|
|
Or you could use
:If M>Z
:Then
:Disp "NEW HIGH SCORE!"
:{M→∟THIEF
:End
for a cleaner and faster code.
Last edited by Guest on 30 Aug 2010 08:09:34 pm; edited 1 time in total |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 30 Jan 2008 12:31:57 pm Post subject: |
|
|
I'm in quarantine with the flu :sick: and I'm going to have lots of time on my hands until the end of the week.
what does the Then command do? normally the If command just encompasses the following line, but Then seems to change that... Wait, does it make the If go all the way to the End? |
|
Back to top |
|
|
luby I want to go back to Philmont!!
Calc Guru
Joined: 23 Apr 2006 Posts: 1477
|
Posted: 30 Jan 2008 12:49:51 pm Post subject: |
|
|
Yes. You can also do this:
If I=5
Then
Disp "I is 5
Else
Disp "I is not 5
End
Last edited by Guest on 30 Aug 2010 08:09:07 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: 30 Jan 2008 03:37:43 pm Post subject: |
|
|
Since you claim to have the time, you might as well read this entire page on TI|BD. |
|
Back to top |
|
|
spandiv -- Retired --
Active Member
Joined: 25 May 2003 Posts: 650
|
Posted: 30 Jan 2008 04:50:25 pm Post subject: |
|
|
alexrudd wrote: Since you claim to have the time, you might as well read this entire page on TI|BD. Since we have finished creating the command pages, he might also be interested in reading those. |
|
Back to top |
|
|
JoostinOnline
Active Member
Joined: 22 Aug 2007 Posts: 559
|
Posted: 30 Jan 2008 05:28:54 pm Post subject: |
|
|
You could do what I did when I was sick: Read the entire manual |
|
Back to top |
|
|
Xphoenix
Elite
Joined: 04 Apr 2007 Posts: 756
|
Posted: 30 Jan 2008 05:43:42 pm Post subject: |
|
|
The manual doesn't really cover programming, more just operations of the calculator.
Or wait . . . You couldn't possibly mean the Part II manual?! That has 696 pages. O_O
And while we're listing awesome TI|BD pages, my favorite is the optimization page. |
|
Back to top |
|
|
Super Speler Super Awesome Dude
Calc Guru
Joined: 28 Nov 2005 Posts: 1391
|
Posted: 30 Jan 2008 05:47:30 pm Post subject: |
|
|
Me, and most of the good TI-Basicer's on this site, have read the manual at least once.
I highly recommend doing so, you will learn a lot.
Last edited by Guest on 30 Jan 2008 05:48:05 pm; edited 1 time in total |
|
Back to top |
|
|
JoostinOnline
Active Member
Joined: 22 Aug 2007 Posts: 559
|
Posted: 30 Jan 2008 05:55:30 pm Post subject: |
|
|
Xphoenix wrote: Or wait . . . You couldn't possibly mean the Part II manual?! That has 696 pages. O_O
[post="119714"]<{POST_SNAPBACK}>[/post]
Actually I read the TI-83 Plus manual, which is much longer than the 84 manual (which I have read as well). I am not sure how long it is, since they dont really have page numbers. |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 30 Jan 2008 06:42:27 pm Post subject: |
|
|
JoostinOnline wrote: You could do what I did when I was sick: Read the entire manual
[post="119712"]<{POST_SNAPBACK}>[/post]
I started just this morning, i think im in page 7... not sure though |
|
Back to top |
|
|
stranger
Advanced Newbie
Joined: 23 Jan 2008 Posts: 63
|
Posted: 31 Jan 2008 03:02:05 pm Post subject: |
|
|
OK, apart from a few chapters and pages and such that I felt I didn't need, (such as how to turn the calc on and off, I mean, seriously, if you buy one of these, you should be able to recognize that the button that says "ON" turns the thing on, and that to achieve "OFF" you have to press the blue button, then the "ON" button) I got most of the things I think I need, but, even though the code seems to be in line, there is a problem storing the variable M to ∟THIEF, every time I open the Edit section of Stat it displays a big, fat [font="Impact"]0
I think the problem happens somewhere at the end of the game, where it displays "NEW HIGH SCORE!" and all. Not 100% sure though.
Not to discredit the manual or anything, because I learned a lot, many things still escape me, but understanding often comes with experience. I'm having fun with the GetKey command, trying to make a game that picks a random key and gives you a few guesses to find the key, with hints along the way. It compliments a game I already have: a "Guess my Number" game that probably needs some updating, but is simple and enjoyable, maybe I'll post it one day...
Last edited by Guest on 13 Feb 2008 07:31:58 pm; edited 1 time in total |
|
Back to top |
|
|
|