http://calcg.org/newlogo2.png Not Logged in.
Login | Register

General Discussion Board \ Calculator Programming \ eight ball

Click here to log in (you must be logged in to post comments).

AuthorComment
thunderflea
Marine
Posted: 4 Oct 2009
17:15 GMT
Total Posts: 15
im working on an eight ball program that you make a wish and it says if it comes true or not.
my issue is that it stops when it gets to label 4. like it displays it then it says done. i want it to go through and display the fortune

Lbl 0
ClrHome
Menu("8BALL","START",1,"INSTRUCTIONS",2,"QUIT",3
Lbl 2
Output(1,1,"CHOOSE WHAT WISH CATAGORY yOU WANT,THEN DO WhAT IT SAYS.
Pause
Goto 0
Lbl 3
Stop

Lbl 1
Menu("CATAGORIES","MONEY",4,"LOVE",4,"SPORTS",4,"BRAINS",4,"OTHER",4
randInt(1,5)üA
randInt(1,2)üB
randInt(3,7)üC
Lbl 4
ClrHome
Output(1,1,"THINK THE WISH AND PLACE HANDS ON SCREEN
For(X,0,1950
End
Goto 11
Lbl 11
If A=1
:Goto 6
If A=2
:Goto 7
If A=3
:Goto 8
If A=4
:Goto 9
If A=5
:Goto 10


Lbl 6
ClrHome
Disp "INTERESTIG...
For(X,0,200C
End
Goto 5
Lbl 7
ClrHome
Disp "OHH HOW STRANGE"
For(X,0,200C
End
Goto 5
End
Lbl 8
ClrHome
Disp "BUT... NO!..."
For(X,0,200C
End
Goto 5
End
Lbl 9
ClrHome
Disp "...LUCKY"For(X,0,200C
End
Goto 5
End
Lbl 10
ClrHome
Disp "........."
For(X,0,200C
End
Goto 5
End

NOT SEEING ITüD
IT WILL HAPPENüE
Lbl 5
ClrHome
If B=1
Output(4,8,D
For(X,0,950
Stop
If A=2
Output(4,8,E
For(X,0,950
Stop
CoffmanRunner
Ultralisk
avatar
Posted: 6 Oct 2009
13:28 GMT
Total Posts: 235
Well your
randInt(1,5)üA
randInt(1,2)üB
randInt(3,7)üC
statements are never going to be executed, they are between the menu and the lbl 4
thus here is what happens, the user enters a category choice and it takes them to label 4 and skips your random assignments
move your random statements so it looks like this now:

<code>
Menu("CATAGORIES","MONEY",4,"LOVE",4,"SPORTS",4,"BRAINS",4,"OTHER",4
Lbl 4
randInt(1,5)üA
randInt(1,2)üB
randInt(3,7)üC
</code>

Because c is probably "0" and so what is happening is it is skipping all the if A=X etc and printing out "INTERESTIG..." then immediately clears the screen and ends the program
make that change I stated above and your program will not end right away.


---
Never gonna let you down...
me2
Goliath
avatar
Posted: 28 Oct 2009
12:46 GMT
Total Posts: 171
I would also recommend replaing all of your answer labels with If...Then...End commands.
So,

:If A=1
:Then
:ClrHome
:Disp "INTERESTING...
:For(X,0,200C
:End
:Goto 5
:End

instead of referencing a label. This will clean up, speed up, and reduce the size of your program. You might also want to correct the spelling errors (catagory should be category, interestig should be interesting). Spelling errors can diminish a game's enjoyment factor.

---
<--- Going out with a bang.





Portal | My Account | Register | Lost Password or Username | TOS | Disclaimer | Help | Site Search | File Archives Copyright © 2002-2019 CalcG.org