home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 80 / basic / games / peg.80 < prev    next >
Encoding:
Text File  |  2001-07-01  |  889 b   |  43 lines

  1. Draw pegs
  2. ------------------------------------------------------------------
  3. Version: 1.0, 971216
  4. Creator: Mattias MorΘn
  5. Description: Draw one, two, or three pegs. If you take the last peg - you loose.
  6. Comments: "->" is the "STO>"-button.
  7. Known bugs: None.
  8. Size: 229 bytes.
  9.  
  10. For more games and programs, please visit http://ti80.burtrask.net.
  11.  
  12. PROGRAM:PEG
  13. CLRHOME
  14. LBL 0
  15. RANDINT(10,20->A
  16. IF FPART (A/4)=.25:GOTO 0
  17. LBL 1
  18. DISP "PEGS LEFT:",A
  19. IF A=1:GOTO 2
  20. INPUT "YOU TAKE: ",B
  21. IF B>3:GOTO 1
  22. IF B<1:GOTO 1
  23. A-B->A
  24. IF A<1:GOTO 2
  25. FPART (A/4)->B
  26. IF B=0:3->B
  27. IF B=.25:RANDINT(1,3->B
  28. IF B=.5:1->B
  29. IF B=.75:2->B
  30. A-B->A
  31. DISP "I TAKE:"
  32. IF A<1:GOTO 3
  33. DISP B
  34. GOTO 1
  35. LBL 2
  36. DISP "I WIN!"
  37. STOP
  38. LBL 3
  39. DISP 1,"YOU WIN!"
  40.  
  41. --------------------------------------------------------------------
  42. Copyright (C) 1998 by Daniel Bergman & Mattias MorΘn
  43. http://ti80.burtrask.net