home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 1 #6 / Commodore_Disk_User_Vol.1_6_1988_-.d64 / addit (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  3KB  |  60 lines

  1. 30 poke53280,0:poke53281,0:printchr$(142)chr$(8):dima(64),b(7,7):print"[147]"tab(17)"[158]addit":b$="                                       ":b1$="[176][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][174]":b2$="[221]  [221]  [221]  [221]  [221]  [221]  [221]  [221]  [221]"
  2. 60 b3$="[171][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][179]":b4$="[173][192][192][177][192][192][177][192][192][177][192][192][177][192][192][177][192][192][177][192][192][177][192][192][189]":d$="":l$=left$(d$,22):print"do you require instructions (y/n) ? ";:gosub720:printa$:ifa$="y"thengosub760
  3. 90 print"how many players ? ";:gosub740:printa$:n=val(a$):ifn=2then110
  4. 100 print:input"what is your name ";p1$:p2$="the computer":goto130
  5. 110 print:input"what is your name, player 1 ";p1$:print:input"what is your name, player 2 ";p2$:p2$=left$(p2$,12)
  6. 130 p1$=left$(p1$,12):n1=25+int((15-len(p1$))/2):n2=25+int((15-len(p2$))/2)
  7. 140 print"[147]"b1$:fory=0to6:printb2$:printb3$:next:printb2$:printb4$:print""tab(29)"scores":printtab(29)"[192][192][192][192][192][192]":printleft$(d$,6)tab(n1)p1$:printleft$(d$,12)tab(n2)p2$:n3=n1-20:n4=n2-20:printl$tab(10)"please wait a moment":r=1:forc=1to64:a(c)=c:next:forc=64to1step-1:readd:e=int(rnd(0)*c)+1:v=a(e)-1
  8. 190 ife<cthenforh=etoc-1:a(h)=a(h+1):next
  9. 200 h=int(v/8):v=v-8*h:b(h,v)=d:gosub330:next:s1=0:s2=0:gosub590
  10. 210 p=1:gosub380:iff=0then230
  11. 220 p=2:gosub400:iff<>0then210
  12. 230 printl$b$l$;:onsgn(s2-s1)+2gosub260,290,300:printd$tab(10)"another game (y/n) ?";:gosub720:ifa$="y"thenrestore:goto140
  13. 250 print"[147]"chr$(9):end
  14. 260 t=20-int((len(p1$)+17)/2):printtab(t)p1$" won by"(s1-s2)"point";:ifs1-s2>1thenprint"s"
  15. 280 return
  16. 290 printtab(12)"it's a draw !             ":return
  17. 300 t=20-int((len(p2$)+17)/2):printtab(t)p2$" won by"(s2-s1)"point";:ifs2-s1>1thenprint"s"
  18. 320 return
  19. 330 cd=h*2+2:l1$=left$(d$,cd):cr=v*3+1:d=b(h,v):printl1$tab(cr)"[146]";:ifr=2thenprint"";
  20. 350 ifd=50thenprint"**[146]":b1=h:b2=v:return
  21. 380 f=300:forv=0to7:f=f+b(b1,v):next:iff=0thenreturn
  22. 400 f=300:forh=0to7:f=f+b(h,b2):next:iff=0thenreturn
  23. 420 y=b1:x=b2:ifn=2orp=1then440
  24. 430 printl$b$l$tab(12)"i'm thinking....":gosub600:goto540
  25. 440 t=20-int((len(n$)+12)/2):printl$b$l$tab(t)"your turn, "n$
  26. 450 geta$:ifa$=""then450
  27. 460 ifa$<>" "then520
  28. 470 x1=x:y1=y
  29. 480 y=y+yy:ify>7theny=0
  30. 490 x=x+xx:ifx>7thenx=0
  31. 500 z=b(y,x):ifabs(z)=50then480
  32. 510 r=1:h=y1:v=x1:gosub330:r=2:h=y:v=x:gosub330:goto450
  33. 520 ifa$<>chr$(13)then450
  34. 530 ifabs(b(y,x))=50then450
  35. 540 ifn=1andp=2thenr=2:h=y:v=x:gosub330
  36. 550 r=1:h=b1:v=b2:b(h,v)=-50:gosub330:h=y:v=x:z=b(h,v):b(h,v)=50:gosub330:ifp=1thens1=s1+z
  37. 570 ifp=2thens2=s2+z
  38. 580 printleft$(d$,19)tab(13)"last taken :"z"[157] "
  39. 590 printleft$(d$,8)tab(30)s1"[157] ":printleft$(d$,14)tab(30)s2"[157] ":return
  40. 600 m=-50:g=-1:fora1=0to7:d=b(a1,b2):ifabs(d)=50then710
  41. 610 x2=-50:fora2=0to7:ifa2<>b2thenk=b(a1,a2):ifk<>-50andk>x2thenx2=k:s=a2
  42. 620 next:ifx2<>-50then640
  43. 630 ifd>mthenm=d:g=a1:goto710
  44. 640 ifg<0theng=a1
  45. 650 fora2=0to7:q=b(a2,s):ifq=-50ora2=a1then700
  46. 660 y2=-50:fora3=0to7:w=b(a2,a3):ifa3=sthen680
  47. 670 ifabs(w)<>50andw>y2theny2=w
  48. 680 next:ify2=-50theny2=0
  49. 690 l=d-x2+q-y2:ifl>mthenm=l:g=a1
  50. 700 next
  51. 710 next:y=g:return
  52. 720 geta$:ifa$<>"y"anda$<>"n"then720
  53. 730 return
  54. 740 geta$:ifa$<>"1"anda$<>"2"then740
  55. 750 return
  56. 760 print" addit is a board game for 1-2 players.":print" every square on the board has a value,":print" and you score points by landing on the":print" squares. you may move in one direction":print" only - horizontally or vertically. you"
  57. 810 print" must press the space  bar to move from":print" square to square and then press return":print" to score, but beware - some squares on":print" the board contain minus values !":printtab(6)"press space bar to continue."
  58. 860 geta$:ifa$<>" "then860
  59. 870 print"[147]":return:data15,10,9,9,8,8,7,7,7,6,6,6,5,5,5,5,4,4,4,4,3,3,3,3,3:data2,2,2,2,2,1,1,1,1,1,0,0,0,0,0,-1,-1,-1,-1,-2,-2,-2,-2:data-3,-3,-3,-3,-4,-4,-4,-5,-5,-5,-6,-6,-7,-7,-9,50
  60.