Horse Racing Game by Daniel Wedge *** MORE GAMES AND PROGRAMS FOR CASIO CALCULATORS AT *** ******** http://www.student.uwa.edu.au/~wedgey ********* I originally saw this as a car game, but I completely rewrote it so that all of the 'cars' (now horses) finish and you can bet on first, second and third. Unfortunately, there's no quinella or trifecta option - in theory my code worked but in practice it didn't :( But I'll keep trying, gotta have something to do in lectures! It's easy to run, just choose the option from the menu that you want! If you have already programmed _my_ Blackjack game into your calculator then a lot of this code is identical, and hence you can interchange money in between games. I originally had a suite of games called Sim Casino but it was too big - over 10000 bytes in the end! and because of its size it was slow, so I've decided to keep the best bits. As with Blackjack there are two programs, you will need to have two free program slots. I know this definitely works on the 9700, it _should_ work on the 9850 as well. (If you can get blackjack running then you can get this to run too.) On the 9700 you can put the second program in Editor mode, as long as you call it "HORSE GRAFX". If you put it into a program slot with a label like Prog A, Prog B, then take a note of which slot you use - you will need it otherwise you won't see anything! Here we go... Symbols used in this program -> Assign key (looks like that, only one tail) => If/then command, under program menu, it has two tails != not equal to >= greater than or equal to <= less than or equal to < less than > greater than ~ tilde / multiple assign (press alpha) @ display command (triangle sign under program menu) t Tera symbol, look under math menu (it's a T with funny ends) Program 1: to be put in a program slot (any one) Size: 1152 bytes 'HORSES Goto 0 Lbl P 125.5 -> H Lbl Q "CHOOSE HORSE (1->6)"? -> G G<1 => Goto Q G>6 => Goto Q Int G != G => Goto Q Lbl T Prog "HORSE GRAFX" or whatever program slot you put the graphics file into 1 -> V~Y 0 -> X "PLACINGS (1-2-3):" " " Lbl U P=V => G=1 => W -> X Q=V => G=2 => W -> X R=V => G=3 => W -> X S=V => G=4 => W -> X T=V => G=5 => W -> X U=V => G=6 => W -> X 2V -> V Isz W W<=3 => Goto U X=1 => 5Z -> F X=2 => 3Z -> F X=3 => 1Z -> F Lbl X P=Y => " HORSE 1" Q=Y => " HORSE 2" R=Y => " HORSE 3" S=Y => " HORSE 4" T=Y => " HORSE 5" U=Y => " HORSE 6" 2Y -> Y Y<=4 => Goto X " "@ Goto 4 Lbl 0 from here you can use the same code as BJ except for *** 0->A~Z Range 23,150,0,1,63,0 " WELCOME TO HORSES"@ *** obviously change to horses from blackjack! 1000 -> X ;1000 is the starting money " " r>X => Goto 5 X -> r "YOUR ACCOUNT OPENED":"WITH":X@ Goto 1 Lbl 1 Cls 0 -> A~W 10 -> Y " " "HORSES" *** change blackjack to horses "1. PLAY" "2. ACCOUNT" "3. QUIT"? -> M M=1 => Goto 2 M=2 => Goto 5 M=3 => Goto 9 Goto 1 Lbl 2 Int 2YRan# -> J J=0 => "JACKPOT!" J=0 => Isz L Goto 3 Lbl 3 "ENTER BET"? -> Z Z=.5 => .5r->Z Z<0 => r->Z Z>r => Goto 3 Z<.01 => Z!=0 => Goto 3 Z>=0 => r-Z -> r 1 -> W Goto P *** Change Goto G to Goto P Lbl 4 J=0 => 10F -> F Z=0 => Goto 6 F=0 => "YOU LOST"@ F=0 => Goto 5 (r+F+Z) -> r r<=0 => 0 -> r Fix 2 "YOU WON:":F@ Goto 5 Lbl 5 Fix 2 F=-1 => "CARRIED OVER:" F!=-1 => "ACCOUNT BALANCE:" r@ Norm r>1t => -1 -> Z ;see symbols Z=-1 => 0 -> r Z=-1 => Goto 8 r=0 => Goto 7 Goto 1 Lbl 6 "YOU BET ZERO" " YOU LOSE ZERO" " YOU WIN ZERO!"@ " " " ALRIGHTY THEN!"@ " " Goto 5 Lbl 7 "YOU ARE BROKE."@ " " " BETTER LUCK" " NEXT TIME."@ Goto 9 Lbl 8 "I AM BROKE."@ " " " GO HOME YOU" " RICH BASTARD."@ Goto 9 Lbl 9 " ":" " " -----------" " :GAME OVER:" " -----------" " ":" " Graphics file Put this program in another slot - if you put it under 'editor' mode then you will need to know what you call the file and then use this to access it where shown above. Size: 468 bytes 'HORSE GRAFX Range 1,127,0,1,63,0 Goto A Lbl B A+6Ran#+2 -> A B+6Ran#+2 -> B C+6Ran#+2 -> C D+6Ran#+2 -> D E+6Ran#+2 -> E I+6Ran#+2 -> I A>H => H->A B>H => H->B C>H => H->C D>H => H->D E>H => H->E I>H => H->I Plot 1,59:Plot A:59:Line:Plot 1,48:Plot B,48:Line: This is all one line, Plot 1,37:Plot C,37:Line:Plot 1,26:Plot D,26:Line: don't press exe until told! Plot 1,15:Plot E,15:Line:Plot 1,4:Plot I,4:Line (EXE) A B C D E I Goto B A=H => P=0 => Q+R+T+S+U+1 -> P B=H => Q=0 => P+R+S+T+U+1 -> Q C=H => R=0 => P+Q+S+T+U+1 -> R D=H => S=0 => P+Q+R+T+U+1 -> S E=H => T=0 => P+Q+R+S+U+1 -> T I=H => U=0 => P+Q+R+S+T+1 -> U P+Q+R+S+T+U=63 => Goto 1 Goto B Lbl A Plot 1,1:Plot 1,63:Line:Plot 62,1:Plot 62,63:Line: all one line again Plot 126,1:Plot 126,63:Line:Plot 127,1:Plot 127,63:Line (EXE) Goto B Lbl 1 END OF FILE