home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / winbatch.zip / STONES.WBT < prev    next >
Text File  |  1991-01-03  |  2KB  |  66 lines

  1. ;Stones game
  2.  
  3. ; s is the number of remaining stones. (15 thru 35)
  4. ; t is the most you can take away at one time  (3 thru 6)
  5. CR=strcat(num2char(13),num2char(10))
  6. textbox("HOW 2 PLAY STONES","stones.wtx")
  7. if WinExist("Clipboard") then WinZoom("Clipboard")
  8. if !WinExist("Clipboard") then runzoom("clipbrd.exe","")
  9.  
  10.  
  11. :playitagainsam
  12. s=random(21)
  13. ;normalize s to be between 15 and 35
  14. s = s + 15
  15.  
  16. t=random(3)
  17. ;normalize t to be between 3 and 6
  18. t = t + 3
  19. v = t + 1
  20.  
  21. clipput("STONES%CR%")
  22. clipappend("Starting with %s% Stones.%CR%")
  23.  
  24. :next
  25.  a=askline("STONES","%s% Stones left. Take 1 to %t% stones","")
  26.  
  27. if a<1 then goto cheat
  28. if a>t then goto cheat
  29. goto gotok
  30.  
  31. :cheat
  32. Message("STONES","You cheat!  You may only take 1 to %t% stones.")
  33. goto next
  34.  
  35. :gotok
  36. clipappend("Human takes %a% stones%CR%")
  37. if a>=s then goto youlose
  38.  
  39. s = s - a
  40. if s==1 then goto complose
  41.  
  42. y =s - 1
  43. y = y mod v
  44. if y == 0 then y = 1
  45. l =s -y
  46. clipappend("Hmm %s% stones left. I take %y% stones, leaving %l%.%CR%")
  47. s = s - y
  48. if s==1 then goto youlose
  49. goto next
  50.  
  51. :youlose
  52. Clipappend("Human stuck with final stone.%CR%")
  53. Message("STONES","Nyah Nyah Nyah.  You Lose.")
  54. goto bye
  55.  
  56. :complose
  57. Clipappend("Hmmm I lost.  Human must be running program on defective CPU.%CR%")  
  58. Message("STONES","Hmmm.  I lost.  CPU must be damaged. Please replace.")
  59. :bye
  60. a=askyesno("STONES","Would you like to play again?")
  61. if a == @TRUE then goto playitagainsam
  62. errormode(@off)
  63. if WinExist("Clipboard") then WinClose("Clipboard")
  64. exit
  65.  
  66.