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

  1. 10 poke56,56:poke55,0:clr
  2. 15 print"[147]":poke53281,0:poke53280,0:gosub60000
  3. 20 dv=peek(186):ifdv<8thendv=8
  4. 30 sys57812"calc font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
  5. 40 sys57812"calc 0340-03c0",dv,0:poke780,0:poke781,64:poke782,3:sys65493
  6. 50 sys57812"calc c000-c149",dv,0:poke780,0:poke781,0:poke782,192:sys65493
  7. 60 poke53272,31
  8. 70 gosub1150:gosub1090
  9. 80 gosub940:dl=1:cr=48:gm=gm+1
  10. 90 rem :: play ::
  11. 100 syssp,0,1:m1=0:m2=0:c1=9:goto200
  12. 110 js=peek(56320)and31:geta$:ifjs=31anda$=""then110
  13. 120 ifa$="v"then570
  14. 130 ifa$="q"then650
  15. 135 ifa$="h"then1400
  16. 140 ifjs=15ora$=chr$(13)then230
  17. 150 if(js=27ora$="[157]")andm2=0thenm1=m1-1-(m1=0)*1
  18. 160 if(js=23ora$="")andm2=0thenm1=m1+1+(m1=4)*1
  19. 170 ifjs=30ora$="[145]"thenm2=m2-1-(m2=0)*1
  20. 180 ifjs=29ora$=""thenm2=m2+1+(m2=4)*1
  21. 190 ifm2>0thensyssp,0,1,37+lr(m2)*24,65+m2*40:m1=0
  22. 200 ifm2=0thensyssp,0,1,37+m1*40,65
  23. 210 goto110
  24. 220 :: choose ::
  25. 230 ifm2=0then410
  26. 240 iflr(m2)=12orc1=9orwr(c1)<0then110
  27. 250 t3=u1:t4=u2:ifc1>0thent3=wp(c1,wr(c1),0):t4=wp(c1,wr(c1),1)
  28. 260 t=lo(m2,lr(m2),1)+m2:t=t+(t>13)*13:ift<>t4thengosub760:goto390
  29. 270 syssp,1,0:ifc1=0then320
  30. 280 :
  31. 290 wr(c1)=wr(c1)-1:ifwr(c1)<0thensyspa,c1*5,0,nc$:goto350
  32. 300 syspa,c1*5,0:c3=wp(c1,wr(c1),0):c4=wp(c1,wr(c1),1):gosub1050:goto350
  33. 310 :
  34. 320 ifdp=52thensyspa,0,0,ec$:goto350
  35. 330 syspa,0,0,uc$
  36. 340 :
  37. 350 syspa,2+lr(m2)*3,m2*5:c3=t3:c4=t4:gosub1040:gosub730
  38. 360 lr(m2)=lr(m2)+1:lo(m2,lr(m2),0)=t3:lo(m2,lr(m2),1)=t4:c1=9
  39. 370 iflr(m2)<12thent=t+m2:t=t+(t>13)*13:print" "mid$("a23456789[166]jqk",t,1)
  40. 380 m1=0:m2=0:cr=cr-1:ifcr=0then640
  41. 390 wait56320,16,15:goto200
  42. 400 :: deck/piles ::
  43. 410 ifm1=0then510
  44. 420 ifur(m1)<0andc1>0then550
  45. 430 ifc1>0then540
  46. 440 :
  47. 450 t$=uc$:ifdp=52thent$=ec$
  48. 460 syssp,1,0:syspa,0,0,t$
  49. 470 syspa,m1*5,0:c3=u1:c4=u2:gosub1050:gosub790
  50. 480 wr(m1)=wr(m1)+1:wp(m1,wr(m1),0)=u1:wp(m1,wr(m1),1)=u2:c1=9
  51. 490 m1=0:m2=0:goto550
  52. 500 :
  53. 510 ifdp=52orc1=0then550
  54. 520 dp=dp+1:u1=dk(dp,0):u2=dk(dp,1)
  55. 530 syspa,0,0:c3=u1:c4=u2:gosub1050
  56. 540 syssp,1,1,7+m1*40,54:c1=m1:gosub790
  57. 550 wait56320,16,15:goto200
  58. 560 :: view card ::
  59. 570 t=wr(m1):ift<1then110
  60. 580 t=t-1:ift<0thengosub790:goto600
  61. 590 syspa,5*m1,0:c3=wp(m1,t,0):c4=wp(m1,t,1):gosub1050
  62. 600 js=peek(56320)and31:geta$
  63. 602 ifjs=31anda$=""then600
  64. 604 ifjs=15ora$="v"then580
  65. 610 syspa,5*m1,0:c3=wp(m1,wr(m1),0):c4=wp(m1,wr(m1),1):gosub1050
  66. 620 goto140
  67. 630 :: quit ::
  68. 640 forl=0to7:gosub790:next
  69. 650 t=0:tc=tc+cr:pokeso,0:gosub1090
  70. 660 syspa,11,10,"[192][192][192][192] game  #"right$(" "+mid$(str$(gm),2),2)" [192][192][192][192]"
  71. 670 syspa,11,12,"cards remaining:"cr
  72. 680 syspa,11,14,"average / game: "int(tc/gm+.5)
  73. 690 syspa,8,21,"fire or return - new game
  74. 695 [158]pa,10,23,"q - quit to loadstar"
  75. 700 [141]790
  76. 702 js[178][194](56320)[175]31:[161]a$
  77. 703 [139]a$[178]"q"[167]40000
  78. 704 [139]js[179][177]15[175]a$[178]""[167]702
  79. 706 [151]198,0:[158]f1
  80. 710 [137]80
  81. 720 :: bing ::
  82. 730 [151]at,10:[151]sr,73:[151]wv,17:[151]hf,50:[151]lf,0:[129]j[178]0[164]333:[130]:[151]wv,16
  83. 740 [142]
  84. 750 :: buzz ::
  85. 760 [151]hf,6:[151]at,0:[151]sr,240:[151]wv,33:[129]j[178]0[164]199:[130]:[151]wv,32
  86. 770 [142]
  87. 780 :: beep ::
  88. 790 [151]sr,240:[151]wv,17:[151]hf,50:[151]lf,35:[151]at,0:[129]j[178]1[164]99:[130]:[151]wv,16
  89. 800 [142]
  90. 810 :: shuffle ::
  91. 820 [158]pa,11,13,"shuffling the deck":[141]790
  92. 830 [139]dl[167]850
  93. 840 t[178]1:[129]l[178]1[164]52:dl(l)[178]t:t[178]t[170]1:[130]
  94. 850 [129]l[178]1[164]52
  95. 860 t1[178][181]([187](1)[172]48[170]5):t2[178][181]([187](1)[172]48[170]5):t[178]dl(t1):dl(t1)[178]dl(t2):dl(t2)[178]t
  96. 870 [130]
  97. 880 [129]l[178]1[164]52
  98. 890 dk(l,0)[178][181]((dl(l))[173]13[170].99)
  99. 900 dk(l,1)[178]dl(l)[171]13[172][181]((dl(l)[171]1)[173]13)
  100. 910 [130]
  101. 920 [142]
  102. 930 :: deal ::
  103. 940 dp[178][187](0):dp[178]0:[141]820:[158]f1
  104. 950 [129]l[178]1[164]4:lr(l)[178]0:wr(l)[178][171]1:dp[178]dp[170]1
  105. 960 [158]pa,0,l[172]5:c3[178]dk(dp,0):c4[178]dk(dp,1):[141]1050:[153]""l[172]2
  106. 970 lo(l,0,0)[178]c3:lo(l,0,1)[178]c4
  107. 980 [130]
  108. 990 [158]pa,25,3,"(NULL)iewcmdcmdcmdtab(tab(tab(on (NULL)uitcmdcmdcmdtab(tab(tab(on (NULL)elpcmdcmdcmdtab(tab(tab("
  109. 1000 [158]pa,0,0,uc$
  110. 1010 [129]l[178]0[164]3:[158]pa,5[170]l[172]5,0,nc$:[130]
  111. 1020 [142]
  112. 1030 :: display card ::
  113. 1040 [153]"waitlist(NULL)cmd(NULL)cmd(NULL)cmd(NULL)ononon";
  114. 1050 [153]ct$(c3)tp$(c4)" (NULL)cmdcmdcmdcmd"cb$(c3)st$(c3)"   cmdcmdcmdcmd   ";
  115. 1060 [153]sb$(c3)"cmdcmdcmdcmd(NULL)wait "ct$(c3)bt$(c4);
  116. 1070 [142]
  117. 1080 :: screen ::
  118. 1090 [151]53280,5:[151]53281,1
  119. 1100 [153]"                        ortantantantantantantantantantantantantan^ ";
  120. 1110 [153]"                        (NULL) calculation (NULL) ";
  121. 1120 [153]"                        /tantantantantantantantantantantantantanexp ":[158]f1
  122. 1130 [142]
  123. 1140 :: initialize ::
  124. 1150 [153]"load"
  125. 1160 [134] c1,c3,c4,cr,dp,gm,js,kb,t,t1,t2,t3,t4,j,k,l,m1,m2,dl,tc,u1,u2,t$
  126. 1170 [134] tp$(13),bt$(13),dk(52,1),dl(52),lo(4,12,1),wp(4,47,1),lr(4),wr(4)
  127. 1180 [134] ct$(4),cb$(4),st$(4),sb$(4)
  128. 1190 ec$[178]"    cmdcmdcmdcmd    cmdcmdcmdcmd    cmdcmdcmdcmd    "
  129. 1200 uc$[178]"wait(NULL)  (NULL)cmdcmdcmdcmd open  wait cmdcmdcmdcmd   wait cmdcmdcmdcmd(NULL)wait  (NULL)"
  130. 1210 nc$[178]"ortantan^cmdcmdcmdcmd(NULL)  (NULL)cmdcmdcmdcmd(NULL)  (NULL)cmdcmdcmdcmd/tantanexp"
  131. 1220 lf[178]54272:hf[178]54273:wv[178]54276:at[178]54277:sr[178]54278:[151]lf[170]24,15:cm[178]49408
  132. 1230 f1[178]49152:f2[178]49155:pa[178]49158:sp[178]49161:so[178]53269:[151]2040,13:[151]2041,14
  133. 1240 [151]53276,1:[151]53285,7:[151]53287,11:[151]53288,6:[151]53277,2:[151]53271,2
  134. 1250 [129]l[178]1[164]13:[135]tp$(l),bt$(l):[130]
  135. 1260 [129]l[178]1[164]4:[135]ct$(l),cb$(l),st$(l),sb$(l):[130]
  136. 1270 [142]
  137. 1280 [131] "peek "," peek","len "," len","str$ "," str$","val "," val","asc "," asc"
  138. 1290 [131] "chr$ "," chr$","left$ "," left$","right$ "," right$","mid$ "," mid$"
  139. 1300 [131] "(NULL)(NULL)","(NULL)(NULL)","(NULL) "," (NULL)","(NULL) "," (NULL)","(NULL) "," (NULL)"
  140. 1310 [131] "waitprint#","waitstop","atn","atn","waitdef","wait","(NULL)","(NULL)"
  141. 1320 [131] "waitdef","wait","(NULL)","(NULL)","waitprint#","waitstop","(NULL)","(NULL)"
  142. 1400 [158]cm,1024,16384,1000:[158]cm,55296,17384,1000
  143. 1405 sq[178][194](so):[151]so,0:sw[178][194](199):[151]199,0
  144. 1410 [151]53281,5:[153]"load       the rules for syscalculation"
  145. 1412 [153]"  to win calculation, play all of the
  146. 1414 print"cards from the deck (upper left corner)
  147. 1416 [153]"to the four rows below. the top row
  148. 1418 print"increases by one, the second by two,
  149. 1420 [153]"the third by three and the fourth by
  150. 1422 print"four. the next card in the sequence is
  151. 1424 [153]"shown where it is to be played. if the
  152. 1426 print"card won't play, drop it on any of the
  153. 1428 [153]"four discard piles (top). the top cards
  154. 1430 print"of the deck and the four discard piles
  155. 1432 [153]"are available for play.
  156. 1436 print"  move the arrow with the crsr keys or
  157. 1438 [153]"the joystick. select with return or
  158. 1440 print"fire, then move to where you want to
  159. 1442 [153]"move it and press returncloseor fire.
  160. 1450 print"  press v with the arrow on a discard
  161. 1452 [153]"pile to see the cards underneath.
  162. 1460 print"  press q to quit.
  163. 1462 [153]"           printpress return or fire"
  164. 1470 js[178][194](56320)[175]31:[161]a$:[139]js[179][177]15[175]a$[179][177][199](13)[167]1470
  165. 1490 [151]53281,1
  166. 1500 [158]cm,16384,1024,1000:[158]cm,17384,55296,1000
  167. 1510 [151]so,sq:[151]199,sw:[137]110
  168. 10000 [159]15,8,15,"s0:calculation":[160]15:[148]"calculation",8:[128]
  169. 40000 a$[178]"hello connect":[129]i[178]8[164]9:[160]2:[159]2,i,2:[160]2:[139]st[167]40020
  170. 40010 [160]15:[159]15,i,15,"r0:"[170]a$[170]"="[170]a$:[132]15,er:[160]15:[139]er[178]63[167]40030
  171. 40020 [130]:[153]"load":[151]2048,0:[151]44,8:[151]53272,23:[151]186,8:[128]
  172. 40030 [151]53281,0:[153]"loadstopload"[199](34)a$[199](34)","i
  173. 40040 [153]"run":[151]44,8:[151]2048,0:[151]631,13:[151]632,13:[151]198,2:[128]
  174. 60000 [153]"load":z$[178]" print#                                      ":[151]214,10:[153]
  175. 60010 [153]" listfrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefre":[129]i[178]0[164]11:[153]z$:[130]
  176. 60020 [153]" pokepospospospospospospospospospospospospospospospospospospospospospo