home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 58 / 058side4.d64 / oscar night (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1986-01-01  |  5.8 KB  |  222 lines

  1. 5 a$=""
  2. 10 goto100
  3. 11 pokes+4,17
  4. 12 fort=0to40:next:pokes+4,16:return
  5. 17  
  6. 18      ***** input routine *****
  7. 19  
  8. 21 poke 198,0:k$=""
  9. 22 poke646,int(rnd(.)*15)+1
  10. 23 print"{CBM-@}";
  11. 24 get a$:if a$=""then 22
  12. 27 ls=len(k$)
  13. 28 ifa$=chr$(13)thena$=k$:print" ":return
  14. 29 ifa$=chr$(20)andlsthenprint" ";:k$=left$(k$,ls-1):goto22
  15. 30 ifa$=" "then34
  16. 31 ifa$>="a"anda$<="z"then34
  17. 32 ifa$>="0"anda$<="9"then34
  18. 33 goto22
  19. 34 if ls>= ln then 22
  20. 35 gosub11:print""a$;:k$=k$+a$
  21. 36 goto22
  22. 47  
  23. 48      ***** error messages *****
  24. 49  
  25. 55 fl=0:close15:open15,8,15:input#15,a$,er$,a$,a$:ifer$="ok"thenclose15:return
  26. 56 poke214,z:print:printcl$:print""tab(20-(len(er$)/2))er$:fl=1
  27. 57 fort=1to5:gosub11:next:close15
  28. 58 fort=1to1000:next
  29. 60 print""cl$:printtab(9)"press space to continue":poke198,0
  30. 62 geta$:ifa$<>" "then62
  31. 64 gosub11:return
  32. 70 poke214,21:print:print""tp$:printmd$:printbt$""
  33. 72 printtab(6)"space - more   return - menu":poke198,0
  34. 74 geta$:ifa$<>" "anda$<>chr$(13)then74
  35. 75 gosub11:ifa$=chr$(13)thenfl=1
  36. 76 return
  37. 97  
  38. 98     ***** set up *****
  39. 99  
  40. 100 poke53272,19:print"":poke53281,0:poke53280,12
  41. 105 cl$="                              ":cr$=chr$(13)
  42. 110 tp$="    O{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}{CBM-Y}P"
  43. 112 md$="    {CBM-H}                              {CBM-N}"
  44. 115 bt$="    L{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{CBM-P}{SHIFT-@}"
  45. 117 os$="oscarparty"
  46. 120 print""tp$:printmd$:printbt$
  47. 122 printos$
  48. 125 print""tp$:printmd$:printbt$
  49. 130 poke214,6:print:printcl$:printtab(9)"this will take a while"
  50. 132 s=54272:fori=stos+24:pokes,0:next
  51. 133 pokes+1,60:pokes+5,17:pokes+6,17:pokes+24,15
  52. 134 dimct$(26),na$(125),pl$(26),ch%(26,126),tw$(26),pt$(26),tw%(26),pt%(26)
  53. 135 dimns%(26),i%(26),cv$(26)
  54. 136 np=0:nc=0:fl=0:goto140
  55. 137  
  56. 138      ***** get data *****
  57. 139  
  58. 140 ip=49152:z=6:open15,8,15:open3,8,3,"player file"
  59. 143 input#3,np:ifnp=0then147
  60. 145 fori=1tonp:sysip,12,3:pl$(i)=a$:next
  61. 147 close3:gosub55:ifflthen140
  62. 150 ifnp=0then160
  63. 153 open3,8,3,"score file"
  64. 155 fori=1tonp:input#3,i%(i):sysip,4,3:pt$(i)=a$:pt%(i)=val(a$)
  65. 157 sysip,4,3:tw$(i)=a$:tw%(i)=val(a$):next
  66. 158 close3
  67. 160 open3,8,3,"categories"
  68. 165 input#3,nc:fori=1tonc:sysip,18,3:cv$(i)=a$:sysip,26,3:ct$(i)=a$
  69. 166 next:close3
  70. 170 open3,8,3,"nominees"
  71. 175 fori=1tonc*5:sysip,30,3:na$(i)=a$:next:close3
  72. 180 open3,8,3,"ballots file"
  73. 182 input#3,nd:ifnd=0then190
  74. 185 fori=1tond:printcl$"":gosub11:printtab(19)nd+1-i"":forj=1tonc*5
  75. 186 sysip,3,3:ch%(i,j)=val(a$):next:next
  76. 190 close3
  77. 195 goto200
  78. 197  
  79. 198      ***** menu *****
  80. 199  
  81. 200 print""tp$:printmd$:printbt$
  82. 210 printos$:poke53269,63
  83. 220 print""tp$:printmd$:printbt$
  84. 225 print""tp$:fori=1to9:printmd$:next:printbt$
  85. 230 poke214,7:print:printtab(14)"oscarnight"
  86. 240 printtab(9)"1.  review ballots"
  87. 242 printtab(9)"2.  view scores"
  88. 244 printtab(9)"3.  and the winner is..."
  89. 246 printtab(9)"4.  return to loadstar"
  90. 265 poke198,0
  91. 280 geta$:ifa$<"1"ora$>"4"then280
  92. 290 gosub11:poke53269,0
  93. 295 onval(a$)goto300,600,400,800
  94. 297  
  95. 298      ***** review ballots *****
  96. 299  
  97. 300 print""tp$:printmd$:printbt$
  98. 315 printtab(14)"theplayers"
  99. 320 fori=1to12
  100. 325 printtab(3)""i"."tab(7)pl$(i)tab(20)""i+12"."tab(23)pl$(i+12)
  101. 330 next
  102. 335 poke214,19:print:print""tp$:printmd$:printbt$
  103. 340 printtab(10)"review ballot of ";
  104. 350 ln=2:gosub21:gosub11:cp=val(a$):ifcp>24then335
  105. 355 ifcp=0then200
  106. 358 i=0
  107. 360 print""tp$:printmd$:printbt$
  108. 365 a$=pl$(cp)+"'s ballot":printtab(20-(len(a$)/2))""a$""
  109. 370 i=i+1:ifi=ncthengosub70:goto200
  110. 375 printtab(5)""ct$(i)
  111. 380 forj=1to5
  112. 385 printtab(8)""ch%(cp,i*5-5+j)tab(10)""na$(i*5-5+j)
  113. 390 next:ifi/3<>int(i/3)then370
  114. 392 gosub70:ifflthenfl=0:goto200
  115. 395 goto360
  116. 397  
  117. 398      ***** the winner is... *****
  118. 399  
  119. 400 print""tp$:printmd$:printbt$
  120. 405 printtab(10)"andthewinneris..."
  121. 410 fori=1to12
  122. 415 print""i"."tab(4)""cv$(i)tab(20)""i+12"."cv$(i+12)
  123. 420 next
  124. 425 poke214,19:print"":printtp$:printmd$:printbt$
  125. 430 printtab(6)"enter the category number ";
  126. 435 ln=2:gosub21:gosub11:cp=val(a$):ifcp>24orcp<1then425
  127. 440 print""tp$:printmd$:printbt$
  128. 445 printtab(10)"and the winner is..."
  129. 450 printtab(20-(len(ct$(cp))/2))""ct$(cp)
  130. 455 forj=1to5
  131. 460 printtab(6)""j"."tab(10)na$(cp*5-5+j)
  132. 465 next
  133. 470 poke214,19:print"":printtp$:printmd$:printbt$
  134. 475 printtab(6)"enter the winner's number {CBM-@}";
  135. 480 geta$:ifa$<"1"ora$>"5"then480
  136. 482 gosub11:printa$:wn=val(a$)
  137. 483 fori=1tonp:ns%(i)=0:next
  138. 485 fori=1tonp:wv=6-ch%(i,cp*5-5+wn):pt%(i)=pt%(i)+wv:pt$(i)=str$(pt%(i))
  139. 490 ifwv=5thentw%(i)=tw%(i)+1:tw$(i)=str$(tw%(i)):ns%(i)=1
  140. 492 iftw%(i)=0thentw$(i)=" 0"
  141. 495 next
  142. 500 print""tp$:printmd$:printbt$
  143. 505 printtab(13)"onthenose!!!"
  144. 510 x=1:fori=1tonp
  145. 515 ifns%(i)=0then530
  146. 520 x=x+1:x=xand1:ifxthenprinttab(20)pl$(i):goto530
  147. 525 printtab(3)pl$(i)""
  148. 530 next
  149. 550 forj=1tonp:i%(j)=int(j):next
  150. 555 forj=npto1step-1
  151. 560 fork=1toj
  152. 565 ifpt%(i%(k))>=pt%(i%(k+1))then575
  153. 570 t=i%(k):i%(k)=i%(k+1):i%(k+1)=t
  154. 575 next:next
  155. 580 poke214,19:print"":printtp$:printmd$:printbt$
  156. 585 printtab(7)"press space to see scores":poke198,0
  157. 590 geta$:ifa$<>" "then590
  158. 595 gosub11:goto600
  159. 597  
  160. 598      ***** standings *****
  161. 599  
  162. 600 print""tp$:printmd$:printbt$
  163. 605 printtab(13)"thestandings"
  164. 607 nn=np/2:ifnn<>int(nn)thennn=nn+1
  165. 610 forj=1tonn
  166. 615 print"  "pl$(i%(j))tab(13)""pt$(i%(j))""tab(17)tw$(i%(j))
  167. 620 next
  168. 625 print"":forj=nn+1tonp-1
  169. 630 print""tab(21)pl$(i%(j))""tab(32)pt$(i%(j))""tab(36)tw$(i%(j))
  170. 635 next
  171. 640 poke214,18:print
  172. 645 print"   and, finally... ";pl$(i%(np))"   "pt$(i%(np))"   "tw$(i%(np))
  173. 660 z=21:poke214,20:print"":printtp$:printmd$:printbt$""
  174. 665 printtab(6)"(p)rint    (s)ave    (m)enu":poke198,0
  175. 670 geta$:ifa$<>"p"anda$<>"s"anda$<>"m"then670
  176. 675 gosub11:ifa$="m"then200
  177. 680 ifa$="p"then700
  178. 682 printcl$cr$tab(17)"saving"
  179. 683 open15,8,15,"i0":gosub55
  180. 685 open3,8,3,"@0:score file,s,w"
  181. 690 fori=1tonp:print#3,i%(i)
  182. 692 print#3,pt$(i)
  183. 694 print#3,tw$(i)
  184. 695 next:close3:gosub55:goto200
  185. 697  
  186. 698      ***** print scores *****
  187. 699  
  188. 700 print""tp$:printmd$:printbt$
  189. 705 printtab(9)"printingthestandings"
  190. 710 close15:open15,4,15:close15:ifst=0then750
  191. 715 print""tp$:printmd$:printbt$
  192. 720 printtab(10)"your printer isn't on"
  193. 730 fort=1to10:gosub11:next:fort=1to2000:next:gosub60
  194. 740 open15,4,15:close15:ifst=0then750
  195. 745 goto200
  196. 750 open4,4
  197. 753 print#4,,,"  !----------------------------!"
  198. 755 print#4,,,"  !  o s c a r    p a r t y    !"
  199. 757 print#4,,,"  !----------------------------!"cr$cr$
  200. 765 print#4,,"player"spc(14)"total points"spc(5)"on the nose"
  201. 767 print#4,,"------"spc(14)"----- ------"spc(5)"-- --- ----"cr$cr$
  202. 770 fori=1tonp-1
  203. 775 print#4,,;pl$(i%(i));spc(24-len(pl$(i%(i))));pt$(i%(i));
  204. 777 print#4,spc(17-len(pt$(i%(i))));tw$(i%(i)):print#4:next
  205. 780 print#4,"and, of course,"cr$
  206. 785 print#4,,;pl$(i%(np));spc(24-len(pl$(i%(i))));pt$(i%(np));
  207. 787 print#4,spc(17-len(pt$(i%(np))));tw$(i%(np)):print#4
  208. 790 print#4:close4
  209. 795 goto200
  210. 800 poke214,21:print
  211. 810 printtab(7)"quit?  are you sure?  (y/n)"
  212. 820 geta$:ifa$<>"y"anda$<>"n"then820
  213. 830 ifa$="n"thenprintcl$:goto265
  214. 840 open15,8,15,"r0:hello connect=hello connect":input#15,er%:close15
  215. 850 ifer%<>63thenend
  216. 860 print""tab(8)"heading back to loadstar"
  217. 870 print"load"chr$(34)"hello connect"chr$(34)",8"
  218. 880 print"run"
  219. 890 poke631,13:poke632,13:poke633,13:poke198,3
  220. 895 poke53272,21:poke2048,0:poke44,8:end
  221. 10000 open15,8,15,"s0:oscar night":close15:save"oscar night",8
  222.