|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|||
|
Programming BASIC games for the TI-84+
Maybe some good source code, guys?
Here's my example for what I've done for a blackjack game: :Lbl A :0->Z :0->X :Menu ("Welcome","Play",B,"Exit",C :Lbl C :Stop :Lbl B :If X>21 :Then :disp "BUST!!" :Pause :Z-5->Z :0->X :Goto J :Else :Goto J :Lbl J :Menu ("Play!","Hit",D,"Stay",E,"Card count",F,"Money left",G,"Exit",H :Lbl H :Goto A :Lbl G :disp "Money",Z :Pause :ClrHome :Goto B :Lbl F :disp "Cards",X :Lbl D :randint(1,10)+X>X :disp "Cards",X :Pause :ClrHome :Goto J :Lbl E :randint(15,21)>Y :Input "Bet", W :If Z<-1 :Then :disp "Bet higher" :Goto E :Else :If Z>11 :disp "Bet lower" :Goto E :Else :Goto I :Lbl I :If Y>X :Then :disp "You lost" :disp "Your cards",X :disp "Computer's cards",Y :pause :ClrHome :Z-W-> :0->X :Goto B :Else :If Y<X :Then :disp "You Won" :disp "Your cards",X :disp "Computer's cards",Y :Pause :ClrHome :0->X :Z+W->Z :Goto B :Else :If X=Y :Then :disp "Tie" :disp "Your cards",X :disp "Computer's cards",Y :Pause :ClrHome :0->X :Goto B Last edited by Dngrsone : July 6th, 2006 at 01:19 PM. |
|
|||
|
Guessing Game
I like the Blackjack game. I've got a guessing game code if anyone wants it. It's somewhat lame, but it's the perfect thing to do if you're just that bored in Math class.
Code:
:ClrHome
:Menu("WELCOME","PLAY",A,"EXIT",B)
:Lbl B
:Stop
:Lbl A
:Disp "GUESS A NUMBER","BETWEEN 1 AND 50"
:randInt(1,50)->X // -> represents the "STO> key"
:Lbl E
:Input C
:If C=X
:Then
:Disp "RIGHT!"
:Goto B
:Else
:Disp "WRONG!"
:End
:If C>X
:Then
:Disp "GUESS LOWER"
:End
:If C<X
:Then
:Disp "GUESS HIGHER"
:End
:While C\=X // \= represents "not equal to"
:Goto E
:End
:Goto B
|
|
||||
|
Quote:
where is the code?????????????? |
|
|||
|
Quote:
hi, i had the same problem with my blackjack game. Maybe you have inversed a goto or a lbl or you just didn't use any so it doesn't come back directly to the main menu |
|
||||
|
alright, as i was riding the bus today i got it all figured out, i had some commands changed...i fixed them..it works now, but now to the fun part, what about the money?
|
|
|||
|
Quote:
Will you post the new code once it's figured out? I'd like to put it on my calc =) |
|
||||
|
Quote:
SCRATCH THAT!!! this one i'm rewriting so that it accounts for more variables allowing you to split the cards, my friend wanted it, it made me so angry...i have to basically rewrite the whole program to account for a two card instead of a random number, but it keeps me busy along with the other 3 i'm programming.... |
|
||||
|
It Is here the moment you have been waiting for...the new improved blackjack...and thanks thedon for giving me something to fill my time with
Lbl 1 Menu(“Welcome”,”Restore”,”2,”New”,A,”Exit”,C Lbl 2 Menu(“Restore”,”Game 1”,3,”Game 2”,4,”Game 3”,5,”Game 4”,6,”Game 5”,7) Lbl 3 Q->Z Goto B Lbl 4 P->Z Goto B Lbl 5 O->Z Goto B Lbl 6 N->Z Goto B Lbl 7 M->Z Goto B Lbl A 0->Z 0->X Menu ("Welcome","Play",B,"Exit",C Lbl C Stop Lbl B disp "Money”,Z Input “Bet”,W If W<0 Then Disp “Bet Higher” Pause Goto B Else IF W>Z Then Disp “Bet Lower” Pause Goto B Else 0->V 0->U 0->T 0->S 0->L randint(1,10)->V Randint(1,10)->U V+U->X If X>21 (I don’t know why I kept this here) Then Disp “Bust” Z-100->Z 0->X Pause Clrhome Goto J Else Clrhome Goto J Lbl J Menu ("Play!","Hit",D,"Stay",E,”Split”,I,"Card count",F,"Money left",G,"Exit",H,”Save”,Z Lbl I If V/=U (/= is not equal to) then goto J else If V=U then 2W->W randint(1,10)->T V+T->X randint(1,10)->S U+S->L Disp “Cards”,V,T Disp “Cards”,U,S Disp “Card Total”,X,L Pause Clrhome If L>X Then L->X Goto E else If X>L Then Goto E Lbl H Goto A Lbl G disp "Money",Z Pause ClrHome Goto B Lbl F disp "Cards",V,U Card Total”,X Pause Clrhome Goto J Lbl D randint(1,10)+X->X disp "Cards",X Pause ClrHome Goto J Lbl E randint(15,24)>Y If Y>21 Then disp "You Win" Disp “Your Cards”,X Disp “computer’s cards”,Y Pause ClrHome Z+W->Z 0->X Goto B Else If X>21 (A little bug, if you and comp bust you still win, house Disp “Bust” busts first) Disp “Your Cards”,X disp “Computers cards”,Y Pause clrhome Z-100->Z (you can adjust this according to your money 0->X reccomendation =10%) Goto B Else If Y>X Then disp "You lost" disp "Your cards",X disp "Computer's cards",Y pause ClrHome Z-W->Z 0->X Goto B Else If Y<X Then disp "You Won" disp "Your cards",X disp "Computer's cards",Y Pause ClrHome 0->X Z+W->Z Goto B Else If X=Y Then disp "Tie" disp "Your cards",X disp "Computer's cards",Y Pause ClrHome 0->X Goto B Lbl Z Menu(“Save”, “Game 1”,8,”Game 2”,9,”Game 3”,10,”Game 4”,11,”Game 5”,12) lbl 8 Z->Q Goto 13 Lbl 9 Z->P Goto 13 Lbl 10 Z->O Goto 13 Lbl 11 Z->N Goto 13 Lbl 12 Z->M Goto 13 Lbl 13 Menu(“Continue?”,B,”Exit”,C) For my version, because I run many other programs involving the variables from M-Q I have just the restore function and I deleted lbl Z and lbls 8 to 13 and instead I write down the number and enter it into the store Z such as my game 1 looks like this: Lbl 3 6200->Z Goto B |
|
|||
|
what
how am i supose to tell whats a zero, a o. help!!!!
|
|
|||
|
Quote:
This is considered a simple program? Last edited by Dngrsone : March 3rd, 2009 at 04:28 PM. |
|
||||
|
Quote:
Pretty straightforward... I think it is. ![]()
__________________
Ask Questions the Smart Way ![]() "In front of a monitor is a dangerous place from which to view the world." --Terri Wells Enable BSOD: Control Panel/Systems, Advanced Tab, hit the Settings button under Startup and Recovery, and under the System Failure area, uncheck the Automatically Restart checkbox. |
|
|||
|
War
Card Game: War
by Michael Goncharov Game Info: This is my first game that I programmed by myself. It's basically a simplified version of "War". When you battle, the calc will give you a random # from 2 to 14. It will also give a "computer player" a random number. The goal is to get a higher number than the enemy. If your number and the computer's number is the same, then it is called a war, and you get taken to a "tie-breaker" round. This game has an infinite amount of rounds, and there is no saving of numbers in the program. But, like I said, It's simplified. Anyways I hope you guys enjoy this one. Code Info: -> is "STO" button above the "on" button Card numbers are 2 through 14. 11=Jack, 12=Queen, 13=King, 14=Ace. _ (underscore) = "Space" button, "Alpha" , "0" randInt( is on button "Math">"Left Arrow">"#5" for each "-" sign, type in minus symbol. Lbl A Menu("------WAR-------","START",B,"CREDITS",C,"EXIT",D Lbl C Menu("____CREDITS_____","PROGRAMMED_BY:",A,"MICHAEL",A,"GONCHAROV",A Lbl D ClrHome Disp "_" Disp "_" Disp "_" Disp "____GOOD-BYE___" Pause ClrHome Stop End Lbl B ClrHome Goto E Lbl E Menu("______WAR_______","BATTLE",F,"QUIT",A Lbl F Disp "YOUR_CARD" Goto G Lbl H Disp X Pause Disp "ENEMYS_CARD" Goto J Lbl K Disp Y Pause Goto L Lbl L If X>Y Then Disp "YOU_WIN" Pause ClrHome Goto E Else If X<Y Then Disp "YOU_LOSE" Pause ClrHome Goto E Else If X=Y Then Disp "______WAR______" Pause ClrHome Goto W Lbl G randInt(2,14)->X Goto H Lbl J randInt(2,14)->Y Goto K Lbl W Disp "______WAR!_____" Disp "_" Disp "YOUR_CARD:" Pause Goto G Disp X Pause Disp "ENEMYS_CARD" Disp Y Pause Goto L By Michael Goncharov I would appreciate any feedback. Thank you. and um... if u decide to show this game to a friend, dont take credit for it... because I said so. ![]() |
![]() |
| Viewing: Dev Hardware Forums > SOFTWARE > Programming > Programming BASIC games for the TI-84+ |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|