home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 October / 1994-10b.d64 / sortanos (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  7KB  |  199 lines

  1. 10 rem    public domain disk # cc2bg
  2. 20 p=828:forj=828to843:readx:pokej,x:next
  3. 30 data 32,155,183,138,72,32,155,183,104,170,164,101,24,76,240,255
  4. 40 l$="[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][192][192][146][152]"
  5. 50 poke53280,7:poke53281, 7:print"[147][142]";
  6. 60 print"[176][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][174]";
  7. 62 forj=1to3:print"[221]";:fort=1to8:poke646,cd:print":[221]:[146]  ";
  8. 63 cd=cd+1:ifcd=7thencd=8
  9. 64 ifcd=9thencd=0
  10. 65 next:print"[157][157][221]";:print"[221]"spc(38)"[221]";:next:goto80
  11. 80 print"[221] [150][209]   [146][208]   [146][208]   [146][208] [207]  [146][208]   [146][208]   [146][208]   [146][208]   [146][208] [150][209] [221]";
  12. 82 print"[221] [215] [150][223] [223][146]   [146][167] [150]  [146][186]  [150]  [146]    [146][186] [150]  [146][167] [150]  [146][167] [150][223] [223][146] [215] [221]";
  13. 84 print"[221] [150][209] [204]  [146]   [146][186]   [146][205]    [146]    [146][167]   [146][167]   [146][186] [204]  [146] [150][209] [221]";
  14. 88 forj=1to3:print"[221]"spc(38)"[221]";
  15. 90 print"[221]";:fort=1to8:poke646,cd:print":[221]:[146]  ";
  16. 91 cd=cd+1:ifcd=7thencd=8
  17. 92 ifcd=9thencd=0
  18. 93 next:   print"[157][157][221]";:next
  19. 94 print"[173][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][189]"
  20. 96 print"[150]   sorta' like dominos but not quite!
  21. 98 [153]"     instructions- [y]ep or [n]ope
  22. 100 getg$:ifg$<>"y"andg$<>"n"then100
  23. 102 ifg$="n"then204
  24. 110 fort=1to36:print:next:print"[147]";
  25. 115 print"  [150][176][144]:[221]:[146] :[221]:[146] :[221]:[146] [159]:[221]:[146] [156]:[221]:[146] :[221]:[146] :[221]:[146] [129]:[221]:[146] [154]:[221]:[146][150][174]"
  26. 116 print"[150]  [221]        - [211] o r t a n o s -        [150][221]
  27. 117 [153]"  def/stop:(NULL):wait :(NULL):wait :(NULL):wait open:(NULL):wait clr:(NULL):wait :(NULL):wait :(NULL):wait for:(NULL):wait cont:(NULL):waitdefexp"
  28. 118 [129]d[178]1[164]1e3:[130]
  29. 120 [153]"onon<";:[141]1500;:[153]"cmdcmdor";:[141]1500:[153]"cmd(NULL)";:[141]1500
  30. 122 [153]"cmd(NULL)";:[141]1500:[153]"cmd/";:[129]t[178]1[164]10:[153]"tan";:[141]1500:[130]
  31. 124 :[153]"> right$nstructions"
  32. 130 [153]"poke(NULL)his game is played with the computer.
  33. 132 print"[197]ach '[211]ortanos' is a pair of numbers
  34. 134 [153]"such as, 63 or 30. (NULL)hey are read as if
  35. 136 print"they were domino tiles 'six/three' and
  36. 138 [153]"'three/blank'. (NULL)ou and the computer are
  37. 140 print"dealt seven tiles each. [212]he rest go to
  38. 142 [153]"the 'boneyard'. atnfter the first tile is
  39. 144 print"played you must respond by placing your
  40. 146 [153]"(NULL)(NULL)(NULL)(NULL)atn(NULL)(NULL)(NULL) next to it with a number which
  41. 148 print"corresponds to one of the numbers of the";
  42. 150 print"tile already in place. [198]or example, if
  43. 152 [153]"the computer had played 63 you could
  44. 154 print"play 46 or 34 (or any combination)
  45. 156 [153]"which included a 6) to the left of the
  46. 158 print"computer's piece, or a piece which
  47. 160 [153]"included a 3 (such as 38 or 03) to the
  48. 162 print"right of the computer's piece.
  49. 164 [153]"        (NULL)ress <(NULL)(NULL)atnlenval>closefor more
  50. 166 getg$:ifg$<>" "then166
  51. 168 print"[147][206]otice that the program automatically
  52. 170 [153]"'flips' your piece around so that the
  53. 172 print"same two numbers are together. [197]xample -";
  54. 174 print" 37:43:62:04[146]. [217]ou will need a tile with
  55. 176 [153]"a 3 or 4 in it - 32wait or 74wait will work.
  56. 178 print"[201]f you put 32[146] at the start, the tiles
  57. 180 [153]"would look like this 23:37:43:62:04wait
  58. 182 print"[201]f you put the 74[146] at the end it would
  59. 184 [153]"reverse and become 47wait.
  60. 186 print"[199]ame ends when one of the players gets
  61. 187 [153]"rid of all his tiles, or when neither
  62. 188 print"player can move - note that you must
  63. 189 [153]"enter '0' when you cannot move and must
  64. 190 print"go to the 'boneyard' for a tile.
  65. 191 [153]"(NULL)he value of each number on the tiles
  66. 192 print"you have at the end of the game is
  67. 193 [153]"totaled (note that 35wait counts a 3+5 not
  68. 194 print"35). [212]he lowest score wins. [212]here are 5
  69. 195 [153]"games in each round and the winner is
  70. 196 print"the one who wins most of the games.
  71. 197 [153]"         (NULL)ress <(NULL)(NULL)atnlenval> to play
  72. 202 getg$:ifg$<>" "then202
  73. 204 poke53280,5:poke53281,15:gosub1270
  74. 210 nt=0:tf=0:gosub1140:ifcl=14thengosub1340:goto300
  75. 220 gosub530:ifnt=1then260
  76. 230 iftf=0then270
  77. 240 sysp,8,3:print"[201]'ll take a tile from the boneyard":gosub1410
  78. 250 ford=1to2e3:next:gosub1340
  79. 260 mf=9
  80. 270 gosub1180:gosub1160:ifhl=14then300
  81. 280 gosub780:gosub1180:ifnt=2then300: rem end
  82. 290 goto210
  83. 300 pu=7:gosub1340:sysp,8,13:print"[197]nd of [199]ame      ":print:gosub1260:gosub1340
  84. 310 mf=9:gosub1180:cs=0:hs=0:print"   [205]y tiles:                   ":print"";
  85. 320 forj=1to14:printc$(j)":";:next
  86. 330 print:print"   [217]our tiles:":print"";
  87. 340 forj=1to14:printh$(j)":";:next:print:print:forj=1to14
  88. 350 ifc$(j)<>""thencs=cs+val(right$(c$(j),1))+val(left$(c$(j),1))
  89. 360 ifh$(j)<>""thenhs=hs+val(right$(h$(j),1))+val(left$(h$(j),1))
  90. 370 h$(j)="":c$(j)=""
  91. 380 next:print"  [193]t the end of that game, your score
  92. 390 [153]"          is"hs"and mine is"cs:[153]""[163]8);
  93. 400 [139]cs[178]hs[167][153]"      right$t's a draw
  94. 410 ifcs<hsthenprint"  [211]o i'm the winner":cg=cg+1
  95. 420 ifhs<csthenprint"[211]o you're the winner":hg=hg+1
  96. 430 print"[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][192][192]";
  97. 440 print"    "cg"games to me,"hg"games to you":ifcg+hg<5then490
  98. 450 print"    [212]hat's five games we've played
  99. 460 [139]cg[177]hg[167][153][163]7)"and i'm the overall winner"
  100. 470 [139]cg[179]hg[167][153][163]5)"and you're the overall winner"
  101. 480 [137]520
  102. 490 [153]" valnter '(NULL)' for a new game, '(NULL)' to end"
  103. 500 [161]a$:[139]a$[179][177]"y"[175]a$[179][177]"n"[167]500
  104. 510 [139]a$[178]"y"[167][153]"load":[141]1280:[137]210
  105. 520 [153]"        (NULL)(NULL), thanks for the games":[128]
  106. 530 mf[178]1:[139]p$[178]""[167]680:[143] 1st move
  107. 540 [158]p,8,2:[153]"peekefore this move right$ have"14[171]cl"tiles...":[141]1380:[141]1260
  108. 550 x[178]0:fl[178]0
  109. 560 pu[178]10:[141]1340:x[178]x[170]1:[139][200](c$(x),1)[178][200](p$,1)[167]fl[178]1:[141]730:[142]
  110. 570 [139][201](c$(x),1)[178][200](p$,1)[167]fl[178]2:[141]730:[142]
  111. 580 [139][200](c$(x),1)[178][201](p$,1)[167]fl[178]3:[141]730:[142]
  112. 590 [139][201](c$(x),1)[178][201](p$,1)[167]fl[178]4:[141]730:[142]
  113. 600 [139]x[179]14[167]560
  114. 610 [158]p,8,2:[153]" right$ cannot move...                   ":[141]1410:[141]1260
  115. 620 x[178]x[170]1:[139]d$(x)[178]""[167]660
  116. 630 y[178]0
  117. 640 y[178]y[170]1:[139]c$(y)[178]""[167]c$(y)[178]d$(x):d$(x)[178]"":tf[178]1:[142]
  118. 650 [139]y[179]14[167]640
  119. 660 [139]x[179]28[167]620
  120. 670 [158]p,8,2:[153]"(NULL)here are no tiles left in boneyard":[141]1260:nt[178]nt[170]1:[142]
  121. 680 x[178]0
  122. 690 x[178]x[170]1:[139][200](c$(x),1)[178][201](c$(x),1)[167]720: [143] double found
  123. 700 [139]x[179]7[167]690
  124. 710 x[178][181]([187](1)[172]7)[170]1
  125. 720 p$[178]c$(x):c$(x)[178]"":[142]
  126. 730 [139]fl[178]1[167]p$[178][201](c$(x),1)[170][200](c$(x),1)[170]":"[170]p$
  127. 740 [139]fl[178]2[167]p$[178]c$(x)[170]":"[170]p$
  128. 750 [139]fl[178]3[167]p$[178]p$[170]":"[170]c$(x)
  129. 760 [139]fl[178]4[167]p$[178]p$[170]":"[170][201](c$(x),1)[170][200](c$(x),1)
  130. 770 c$(x)[178]"":[142]
  131. 780 mf[178]2:[158]p,8,2:[153]"left$ere is your hand -                  ":[153]l$:[141]1380
  132. 790 [129]g[178]1[164]14:[139]g[178]6[167][158]p,11,0
  133. 800 [139]g[177]5[175]g[179]11[167]840
  134. 810 [139]g[178]11[167][158]p,11,0
  135. 820 [139]g[177]10[167]850
  136. 830 [139]h$(g)[179][177]""[167][153][166]7)g"- "h$(g):[137]860
  137. 840 [139]h$(g)[179][177]""[1