home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 6 / 006.d81 / bingo (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  195 lines

  1. 10 rem *** bingo
  2. 11 rem *** by john beltrami
  3. 12 rem *** translated for the commodore
  4. 13 rem *** by donna k. woody
  5. 20 s$="  ":dima(5,5),b(75)
  6. 30 poke53281,1:poke53280,15:printchr$(144)
  7. 40 poke783,peek(783)and254
  8. 50 gosub3000:rem *** openers
  9. 100 rem *** main menu ***
  10. 110 printchr$(147)
  11. 115 poke781,1:poke782,13:sys65520:print"* * * * * * * *"
  12. 120 poke781,3:poke782,13:sys65520:print"   b i n g o  "
  13. 125 poke781,5:poke782,13:sys65520:print"* * * * * * * *[144]"
  14. 130 poke781,8:poke782,10:sys65520:print"1 - instructions"
  15. 140 poke781,10:poke782,10:sys65520:print"2 - print bingo cards"
  16. 150 poke781,12:poke782,10:sys65520:print"3 - start the game"
  17. 160 poke781,14:poke782,10:sys65520:print"4 - quit"
  18. 170 poke781,20:poke782,0:sys65520:print"your choice - ";
  19. 180 poke198,0:wait198,1:gety$:y=val(y$)
  20. 200 ify=4then4000:rem *** end
  21. 210 ify=3then1000:rem *** game
  22. 220 ify=2then500:rem *** cards
  23. 230 ify=1then5000:rem *** instructions
  24. 235 goto170
  25. 498 :
  26. 499 rem *** cards
  27. 500 printchr$(147)
  28. 520 poke781,2:poke782,0:sys65520
  29. 525 input"how many bingo cards do you need";y$
  30. 527 n=val(y$):ifn<1then900
  31. 530 poke781,4:poke782,0:sys65520:print"output these cards to the (p[144])rinter"
  32. 535 print"                or to the (s[144])creen?";
  33. 536 poke198,0:wait198,1:getp$:printp$
  34. 540 ifp$="p"thenopen4,4:cmd4:goto550
  35. 545 ifp$<>"s"thengoto530
  36. 548 :
  37. 549 rem *** routine
  38. 550 fornn=1ton
  39. 600 fori=1to75:b(i)=0:nexti
  40. 620 fori=1to5
  41. 630 ll=i*15-15
  42. 640 forj=1to5
  43. 650 k=int(rnd(1)*15+1)
  44. 660 r=k+ll
  45. 670 ifb(r)>0thengoto650
  46. 680 b(r)=1
  47. 690 a(i,j)=r
  48. 700 nextj
  49. 710 nexti
  50. 720 print:print:print
  51. 730 print"    b      i      n      g      o"
  52. 735 print
  53. 740 forj=1to5
  54. 750 f$=""
  55. 760 fori=1to5
  56. 770 ifi=3andj=3then850
  57. 780 c$=str$(a(i,j))
  58. 790 l=len(c$):ifl<3thenc$=" "+c$
  59. 800 f$=f$+s$+c$+s$
  60. 810 goto860
  61. 850 f$=f$+"  free "
  62. 860 nexti
  63. 870 printf$:print
  64. 880 nextj
  65. 885 ifp$<>"p"thenprint:print"press <return>[160]";:poke198,0:wait198,1:gety$
  66. 890 nextnn
  67. 895 ifp$="p"thenprint#4:close4
  68. 900 goto100
  69. 998 :
  70. 999 rem *** game
  71. 1000 printchr$(147)
  72. 1020 print"      b    i    n    g    o"
  73. 1030 print
  74. 1040 t=0
  75. 1050 fori=1to75:b(i)=0:nexti
  76. 1060 poke781,19:poke782,9:sys65520:print"last number:"
  77. 1065 poke781,19:poke782,25:sys65520:print"<--"
  78. 1100 poke781,20:poke782,5:sys65520:print"<return> for next number"
  79. 1110 poke781,21:poke782,5:sys65520:print"<q> to quit game"
  80. 1115 ift>74then1400
  81. 1119 poke781,19:poke782,22:sys65520
  82. 1120 poke198,0:wait198,1:gety$:ify$=chr$(13)then1200
  83. 1130 ify$<>"q"then1110
  84. 1140 poke781,23:poke782,5:sys65520:print"are you sure?[160]";:poke198,0:wait198,1:gety$
  85. 1150 ify$<>"y"thenpoke781,23:poke782,1:sys65520:forx=1to38:print" ";:next:goto1100
  86. 1160 goto100
  87. 1200 r=int(75*rnd(1)+1)
  88. 1210 ifb(r)>0then1200
  89. 1212 b(r)=1
  90. 1213 t=t+1
  91. 1215 h1=1
  92. 1220 ifr>15thenh1=2
  93. 1230 ifr>30thenh1=3
  94. 1240 ifr>45thenh1=4
  95. 1250 ifr>60thenh1=5
  96. 1260 h=h1*5-1
  97. 1270 v=r-(h1-1)*15+2
  98. 1280 r$=str$(r):l=len(r$):ifl<3thenr$=" "+r$
  99. 1300 poke781,v:poke782,h:sys65520:printr$
  100. 1320 poke781,19:poke782,22:sys65520:printr$
  101. 1330 goto1100
  102. 1398 :
  103. 1399 rem *** numbers exhausted
  104. 1400 poke781,22:poke782,5:sys65520
  105. 1410 print"all numbers have been called!"
  106. 1415 poke781,23:poke782,1:sys65520
  107. 1425 print"press <space bar> to continue.";
  108. 1430 poke198,0:wait198,1:gety$:ify$<>" "then1415
  109. 1440 goto100
  110. 1900 goto100
  111. 2998 :
  112. 2999 rem *** openers
  113. 3000 printchr$(147)
  114. 3010 poke783,peek(783)and254
  115. 3020 poke781,1:poke782,13:sys65520
  116. 3030 print"john  beltrami"
  117. 3040 poke781,4:poke782,13:sys65520
  118. 3050 print"   presents"
  119. 3055 poke781,7:poke782,16:sys65520:print"b i n g o"
  120. 3060 h=14:v=6
  121. 3110 fork=16to24step2
  122. 3120 forj=8to16step2
  123. 3125 poke781,j:poke782,k:sys65520
  124. 3130 print" [144]";
  125. 3140 nextj:nextk
  126. 3170 gosub3400:print"b"
  127. 3175 gosub3300
  128. 3180 gosub3400:print"[156]i"
  129. 3185 gosub3300
  130. 3190 gosub3400:print"[158]n"
  131. 3195 gosub3300
  132. 3200 gosub3400:print"[149]g"
  133. 3205 gosub3300
  134. 3210 gosub3400:print"[152]o[144]"
  135. 3215 gosub3300
  136. 3230 poke781,20:poke782,13:sys65520:print"copyright 1984"
  137. 3240 poke781,22:poke782,6:sys65520:print"press <space bar> to continue";
  138. 3245 poke198,0:wait198,1:gety$
  139. 3254 y=rnd(1)
  140. 3260 ify$<>" "then3240
  141. 3270 return
  142. 3298 :
  143. 3299 rem *** delay
  144. 3300 forj=1to300:nextj
  145. 3350 return
  146. 3398 :
  147. 3399 rem *** format
  148. 3400 h=h+2
  149. 3420 v=v+2
  150. 3430 poke781,v:poke782,h:sys65520
  151. 3490 return
  152. 3998 :
  153. 3999 rem *** end
  154. 4000 printchr$(147)
  155. 4020 poke781,6:poke782,15:sys65520:print"thanks  for"
  156. 4030 print"playing"
  157. 4040 print"b i n g o !"
  158. 4050 print"load"chr$(34)"payload"chr$(34)",8":print"run"
  159. 4055 poke631,13:poke632,13:poke198,2:end
  160. 4998 :
  161. 4999 rem *** instructions
  162. 5000 printchr$(147)
  163. 5020 print"bingo is a simple game that requires":print
  164. 5022 print"you to mark your card as numbers are":print
  165. 5024 print"called out.  you can play bingo with":print
  166. 5026 print"any standard bingo cards.  if you need":print
  167. 5028 print"cards, consult the <print> option on":print
  168. 5030 print"the main menu after you complete this":print
  169. 5032 print"section."
  170. 5040 poke781,23:poke782,4:sys65520:print"press <space bar> to continue."
  171. 5042 poke198,0:wait198,1:gety$:ify$<>" "then5040
  172. 5050 printchr$(147)
  173. 5060 print"bingo is played by completing any row":print
  174. 5062 print"or column of 5 numbers (or 'free spot')":print
  175. 5064 print"with a mark.  diagonals also win.  some":print
  176. 5066 print"people use variations that include":print
  177. 5068 print"inner and outer squares, four corners,":print
  178. 5072 print"and others.  this program does not care":print
  179. 5074 print"how you play!!!!"
  180. 5076 poke781,23:poke782,4:sys65520:print"press <space bar> to continue."
  181. 5077 poke198,0:wait198,1:gety$:ify$<>" "then5040
  182. 5090 printchr$(147)
  183. 5100 print"bingo will randomly call out the":print
  184. 5102 print"numbers until you indicate that someone":print
  185. 5104 print"has won.  called numbers are":print
  186. 5106 print"continuously displayed.":print
  187. 5108 print"    g o o d - l u c k  !"
  188. 5200 poke781,23:poke782,4:sys65520:print"press <space bar> to continue."
  189. 5210 poke198,0:wait198,1:gety$:ify$<>" "then5040
  190. 5250 printchr$(147)
  191. 5900 goto100
  192. 63000 rem     link back
  193. 63010 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  194. 63020 poke198,0:poke631,13:poke632,13:poke198,2:end
  195.