home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1984 Half 2 / rerun-1984-07-12.d64 / slide.mod (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  118 lines

  1. 10 poke51,0:poke52,96:poke55,0:poke56,96:gosub1200
  2. 20 input"what level-2,4,6,or 8";wg:wg=int(wg)
  3. 30 if wg<2thenwg=2
  4. 40 ifwg>8thenwg=8
  5. 50 ifwg=3orwg=5orwg=7thenwg=wg+1
  6. 60 print"level=";wg
  7. 70 ru= 24784:au=28927:lu=28926:iu=28908:rt=24576
  8. 80 gosub370
  9. 90 cc=1:bq=0
  10. 100 print"you first?"
  11. 110 geta$:ifa$=""then110
  12. 120 ifa$="y"thenaq=1:goto140
  13. 130 aq=-1:bq=1:gosub530:gosub720:goto150
  14. 140 gosub530
  15. 150 print"                                   ";
  16. 160 ifbq>0thenprint"my move "v$(bq);
  17. 170 print" your move?  [157]"
  18. 180 geta$
  19. 190 ifa$=""then180
  20. 200 print"          your move ";a$
  21. 210 if(a$>"0"anda$<"6")thenbq=asc(a$)-48:goto240
  22. 220 if(a$>="a"anda$<="e")thenbq=asc(a$)-59:goto240
  23. 230 goto150
  24. 240 aq=1:gosub720
  25. 260 pokelz,0:sysrt:ifpeek(cz)=1thenprint"you win!      ":t4=t4+1:goto1080
  26. 270 ifpeek(cz+1)=1thenprint"i win!              ":s4=s4+1:goto1080
  27. 280 ifcc<4then350
  28. 290 sys25008
  29. 300 bq=peek(28940):ifbq=0thenbq=1
  30. 310 aq=-1:gosub720
  31. 320 pokelz,0:sysrt:ifpeek(cz+1)=1thenprint"i win!     ":s4=s4+1:goto1080
  32. 330 ifpeek(cz)=1thenprint"you win!         ":t4=t4+1:goto1080
  33. 340 goto150
  34. 350 cc=cc+1:bq=int(rnd(xx)*10+1)
  35. 360 goto310
  36. 370 rem initialize
  37. 380 s=1024:dn=40:rem for 40-column screen use dn=40
  38. 400 mr=8:mc=13
  39. 410 poke28958,wg
  40. 420 lc=s+dn*mr+mc:d2=2*dn
  41. 430 vb=93:hb=64:xx=91:th=114:bh=113:lh=107:rh=115
  42. 440 printchr$(142)
  43. 450 ul=112:ur=110:bl=109:br=125
  44. 460 wh=81:bk=86
  45. 470 a=28416:cz=28872:pz=28874:lz=28897
  46. 490 data1,2,3,4,5,a,b,c,d,e
  47. 500 fori=1to10:readv$(i):next
  48. 510 fori=0to24:pokea+i,0:nexti
  49. 520 return
  50. 530 rem build screen
  51. 540 print"[147]":sys25344
  52. 550 fori=1to5
  53. 560 pokelc+2*i,48+i
  54. 570 pokelc+d2*i,i
  55. 580 forj=0to5
  56. 590 pokelc+d2*i+1+2*j,vb
  57. 600 pokelc+2*i+d2*j+dn,hb
  58. 610 nextj:nexti
  59. 620 fori=1to4:forj=1to4
  60. 630 pokelc+dn+1+2*i+d2*j,xx
  61. 640 nextj
  62. 650 pokelc+dn+1+2*i,th
  63. 660 pokelc+11*dn+1+2*i,bh
  64. 670 pokelc+dn+1+d2*i,lh
  65. 680 pokelc+dn+11+d2*i,rh
  66. 690 nexti
  67. 700 pokelc+1+dn,ul:pokelc+dn+11,ur:pokelc+11*dn+1,bl:pokelc+11*dn+11,br
  68. 705 print"[154]":printtab(25);"your token [209]":printtab(25);"my   token [214]"
  69. 710 return
  70. 720 rem insert token into current copy of game and also screen.
  71. 730 rem on entry aq=1 if player is white, -1 if black.
  72. 740 rem bq in range 1-5 for column, 6-10 for row.
  73. 750 tq=wh:nq=1:ifaq=-1thentq=bk:nq=255
  74. 760 cq=bq-1:ifbq>5then870
  75. 770 gosub980:ifqq=0then840
  76. 780 fori=qqto1step-1
  77. 790 iq=i-1
  78. 800 eq=peek(a+5*iq+cq):pokea+5*i+cq,eq
  79. 810 vq=peek(lc+d2*i+bq*2)
  80. 820 pokelc+d2+d2*i+bq*2,vq
  81. 830 nexti
  82. 840 pokea+cq,nq
  83. 850 pokelc+d2+bq*2,tq
  84. 860 goto970
  85. 870 cq=bq-6:rq=5*cq:gosub1030
  86. 880 ifqq=0then950
  87. 890 fori=qqto1step-1
  88. 900 iq=i-1
  89. 910 eq=peek(a+rq+iq):pokea+rq+i,eq
  90. 920 vq=peek(lc+d2+d2*cq+i*2)
  91. 930 pokelc+d2+d2*cq+i*2+2,vq
  92. 940 nexti
  93. 950 pokea+rq,nq
  94. 960 pokelc+d2+d2*cq+2,tq
  95. 970 return
  96. 980 qq=4
  97. 990 fori=0to3
  98. 1000 ifpeek(a+5*i+cq)=0thenqq=i:i=4
  99. 1010 nexti
  100. 1020 return
  101. 1030 qq=4
  102. 1040 fori=0to3
  103. 1050 ifpeek(a+rq+i)=0thenqq=i:i=4
  104. 1060 nexti
  105. 1070 return
  106. 1080 print"games: you ";t4;"   me ";s4
  107. 1090 print"want another game?"
  108. 1100 geta$
  109. 1110 ifa$=""then1100
  110. 1120 ifa$><"n"thengosub510:goto90
  111. 1130 print"thank you":stop
  112. 1200 print"[147]                 slide"
  113. 1210 print"            by robert rossa"
  114. 1220 print"       arkansas state university"
  115. 1230 print:print:print"    get five tokens in a row to win"
  116. 1240 fori=1to2000:next
  117. 1250 return
  118.