home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 56 / 056.d81 / speed (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  8KB  |  233 lines

  1. 100 rem ***speed***
  2. 110 sd=54272:for a=sd to sd+24:poke a,0:next:x$=chr$(13)
  3. 120 poke53280,0:poke53281,0:poke53283,1
  4. 130 printchr$(8);chr$(142);
  5. 140 print"[147]loading data...[144]"
  6. 150 if cd=1 then 170
  7. 160 poke147,0:sys57812"speed char",8,1:sys62631
  8. 170 dim card$(4,13):open4,8,4,"0:speed cards,s,r"
  9. 180 fora=1to4:forb=1to13:input#4,ca$(a,b):next:next:close4
  10. 190 dimc(52):dimha(2,4):dimtw(2,5):dimp(2,21)
  11. 200 fori=1to52:c(i)=i:next
  12. 210 bc$="[159]sssss[157][157][157][157][157]sssss[157][157][157][157][157]sssss[157][157][157][157][157]sssss[157][157][157][157][157]sssss[157][157][157][157][157]sssss"
  13. 220 bl$="     [157][157][157][157][157]     [157][157][157][157][157]     [157][157][157][157][157]     [157][157][157][157][157]     [157][157][157][157][157]     "
  14. 230 for a=49152to49296:readb:pokea,b:next:sys49194:poke2,0
  15. 240 data169,1,141,25,208,162,59,160,216,173,18,208,197,2,176,9,169,31,141,24,208
  16. 250 data165,2,208,11,162,27,160,200,169,21,141,24,208,169,0,141,18,208,76,128
  17. 260 data192,173,20,3,141,160,3,173,21,3,141,161,3,120,169,0,141,20,3,169
  18. 270 data192,141,21,3,169,1,141,26,208,169,27,141,17,208,169,127,141,13,220,88
  19. 280 data96,120,173,160,3,141,20,3,173,161,3,141,21,3,169,240,141,26,208,169,27
  20. 290 data141,17,208,169,0,141,13,220,169,120,141,25,208,169,21,141,24,208,32,132
  21. 300 data255,88,96,248,104,104,173,13,220,41,1,240,3,76,49,234,76,188,254,0,0,0,0
  22. 310 poke53280,14:poke53281,14:printchr$(142)"[147][146]";
  23. 320 poke53272,21:poke53265,27
  24. 330 print"[144][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]";
  25. 340 fora=1to22:print"[221]"spc(38)"[221]";:next:print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
  26. 350 fora=217to242:pokea,peek(a)or128:next
  27. 360 print"          loadstar presents:"
  28. 370 print"                               "
  29. 380 print"                 speed          "
  30. 390 print"                                "
  31. 400 print"             by jason olds      "
  32. 410 print"                                "
  33. 420 print"            copyright  1987     "
  34. 430 print"                                "
  35. 440 print"                                "
  36. 450 print"                               "
  37. 460 remifpeek(203)<>60then420
  38. 470 poke198,0:print"[145][144]do you need instructions?  (y/n) "
  39. 480 geta$:ifa$=""then480
  40. 490 ifa$="y"thenpoke53280,0:poke53281,0:goto1250
  41. 500 ifa$="n"thengosub2350:goto520
  42. 510 goto 480
  43. 520 rem ***setup board***
  44. 530 print"[147]":poke 53265,peek(53265)or64
  45. 540 poke 2,210:poke53280,0:poke53281,6
  46. 550 dp=1
  47. 560 fori=1to51:r=(53-i)*rnd(0):r=int(r)+i:t=c(r):c(r)=c(i):c(i)=t:next
  48. 570 tc=21:tp=21
  49. 580 print"-----------------[158]speed------------------";
  50. 590 print"[153]1-4 to select card   space to draw card"
  51. 600 print"          q to quit to loadstar"
  52. 610 print"";bc$
  53. 620 print"[157][157][157][157][157][157][157][157][157][157][157][157][157][157]";bc$
  54. 630 print"";bc$
  55. 640 print"";bc$
  56. 650 print"";bc$
  57. 660 print"";bc$
  58. 670 rem print"select speed (1-9), 1 is fastest"
  59. 680 remgeta$:ifa$=""then590
  60. 690 rem sp=val(a$):ifsp<1orsp>9then590
  61. 700 print"                                       "
  62. 710 for a=1 to 10:gosub1780:tw(int(a/6)+1,a+(5*(a>5)))=c(a):next
  63. 720 for a=11 to 31:p(1,a-10)=c(a):next
  64. 730 for a=32 to 52:p(2,a-31)=c(a):next
  65. 740 pp=1:cp=1
  66. 750 for a=1 to 4:ha(1,a)=p(1,pp):pp=pp+1:next
  67. 760 for a=1 to 4:ha(2,a)=p(2,cp):cp=cp+1:next
  68. 770 fora=1to4:nu=ha(1,a):gosub1780:print""spc((a-1)*7+6);ca$(x,y)
  69. 780 next
  70. 790 print"--1--  --2--  --3--  --4--"
  71. 800 rem ***flip over stack cards***
  72. 810 for a=1 to 500:next
  73. 820 print"";bc$;"[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";bc$
  74. 830 poke214,20:print:print"get ready...                ":fora=1to750:next
  75. 840 poke214,20:print:print"get set.....":fora=1to750:next
  76. 850 poke214,20:print:print"go!!!!!!!!!!"
  77. 860 print"";:nu=tw(1,dp):gosub1780:printca$(x,y)
  78. 870 print"";:nu=tw(2,dp):gosub1780:printca$(x,y)
  79. 880 s1=tw(1,dp):s2=tw(2,dp):dp=dp+1
  80. 890 rem ****main input procedure****
  81. 900 ti$="000000"
  82. 910 geta$
  83. 920 iftp=0then2220
  84. 930 iftc=0then2310
  85. 940 ifa$>"0"anda$<"5"thengosub1020:poke198,0
  86. 950 ifa$="q"then1790
  87. 960 ifa$=x$thengosub1950:ifcm=1thengoto1820
  88. 970 ifa$=" "thengosub1860
  89. 980 ifval(ti$)=spthenti$="000000":gosub1950
  90. 990 if cm=1 then print"the computer has no move.";
  91. 1000 ifcm=1thenprint" press return.";
  92. 1010 goto 910
  93. 1020 rem ***player wants to move card***
  94. 1030 print"you:";tp;"[157]  computer:";tc;"[157]               "
  95. 1040 cd=val(a$):forcl=1895to1903:pokecl,32:next
  96. 1050 cv=ha(1,cd):ifcv=-2thenreturn
  97. 1060 nu=s1:gosub1780:s3=y:nu=s2:gosub1780:s4=y
  98. 1070 nu=cv:gosub1780
  99. 1080 if(y=s3+1ory=s3-1)or(y=13ands3=1)or(y=1ands3=13)then1140
  100. 1090 if(y=s4+1ory=s4-1)or(y=13ands4=1)or(y=1ands4=13)then1190
  101. 1100 rem ***beep***
  102. 1110 pokesd+24,15:pokesd+5,31:pokesd+6,208:pokesd,240:pokesd+1,4:pokesd+4,33
  103. 1120 fors=1to200:next:pokesd+4,0:pokesd,0:pokesd+1,0:pokesd+24,0
  104. 1130 return
  105. 1140 print""spc((cd-1)*7+6);bl$
  106. 1150 print"";ca$(x,y)
  107. 1160 s1=ha(1,cd):ha(1,cd)=-2
  108. 1170 tp=tp-1
  109. 1180 return
  110. 1190 print""spc((cd-1)*7+6);bl$
  111. 1200 print"";ca$(x,y)
  112. 1210 s2=ha(1,cd):ha(1,cd)=-2
  113. 1220 tp=tp-1
  114. 1230 return
  115. 1240 end
  116. 1250 rem ***instructions***
  117. 1260 poke 53283,2:p5%=peek(53272)
  118. 1270 poke 53265,peek(53265)or64
  119. 1280 print"[147]                  speed                 "
  120. 1290 print"[159]    the object is to discard all cards"
  121. 1300 print" from your hand and stack before the"
  122. 1310 print" computer does."
  123. 1320 print"    [158]five cards are dealt to each stack"
  124. 1330 print" face down.  the remaining cards are"
  125. 1340 print" dealt between you and the computer"
  126. 1350 print" face-down.  these cards are called the"
  127. 1360 print" reserves."
  128. 1370 print"[156]    before play, the two stacks"
  129. 1380 print" are shown along with the four cards in"
  130. 1390 print" the computer's hand.  these cards will"
  131. 1400 print" remain face down until played.  your"
  132. 1410 print" options will be displayed at the"
  133. 1420 print" bottom of the screen."
  134. 1430 print
  135. 1440 print"       press space to continue"
  136. 1450 ifpeek(203)<>60then1450
  137. 1460 print"[147]                  speed                 "
  138. 1470 print"    a card from each stack is moved to"
  139. 1480 print" the center piles face-down.  when"
  140. 1490 print" the cards are turned over, the race"
  141. 1500 print" begins."
  142. 1510 print"[159]    you can play a card that is one[159]"
  143. 1520 print" higher or one[159] lower than any facing"
  144. 1530 print" up in the stack."
  145. 1540 print"    [158]ex: a two could be placed on an"
  146. 1550 print" ace or a ten on a jack.  suits are of"
  147. 1560 print" equal value."
  148. 1570 print"[159]    the card you play will become a"
  149. 1580 print" new play card.  deal yourself new"
  150. 1590 print" card by pressing space[146][159].  this removes"
  151. 1600 print" a card from the reserve."
  152. 1610 print"       press space to continue"
  153. 1620 ifpeek(203)<>60then1620
  154. 1630 print"[147]                  speed                 "
  155. 1640 print"[158]    if you can't find a move, wait for"
  156. 1650 print" the computer to say that it can't"
  157. 1660 print" move either.  then hit the return[146][158] key"
  158. 1670 print" move on.  two more cards will be taken"
  159. 1680 print" from the stacks.  when signalled to"
  160. 1690 print" go, the computer will immediately try"
  161. 1700 print" to move, so be ready!"
  162. 1710 print"    hint: start out with a slow speed"
  163. 1720 print" until you get the hang of the game."
  164. 1730 print" then move up as your skill increases."
  165. 1740 printtab(13)"[152]-good luck!"
  166. 1750 print"       press space to continue"
  167. 1760 ifpeek(203)<>