home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1985 Spring / rerun-1985-spring.d64 / scrambler (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  102 lines

  1. 5 rem scrambled words 64
  2. 10 si=54272:kp=0
  3. 15 poke53280,1:poke53281,1:poke646,6
  4. 20 dim wl$(30),ri(30)
  5. 25 gosub455:input"how many players";pl:ifpl=0thenpl=1
  6. 30 input"how many words to enter";nw:ifnw=0thennw=1
  7. 35 dimwd$(pl-1,nw-1),wl(pl-1,nw-1),n$(pl-1),ps(pl-1)
  8. 40 fork=0topl-1
  9. 45 gosub455:print"player";k+1;"'s name";:inputn$(k)
  10. 50 forx=0tonw-1
  11. 55 print""n$(k)"!"
  12. 60 print"enter one word or phrase to be scrambled";
  13. 65 print"       (limited to 30 characters)"
  14. 70 print"[173]";:forj=0to29:print"[195]";:next:print"[189]"
  15. 75 print"";:gosub365
  16. 80 l=len(w$):ifl>30thengosub455:goto55
  17. 85 ifl=0then75
  18. 90 ifl=1then75
  19. 95 gosub465:gosub470:ifr=1thengosub465:goto75
  20. 100 wd$(k,x)=w$:wl(k,x)=l:nextx,k
  21. 105 forz=0tonw-1:yy=0:fory=pl-1to0step-1:yy=yy+1:gosub455
  22. 110 w$=wd$(y,z):l=wl(y,z):sc=ps(yy-1):ws=l*200
  23. 115 print""tab(14)"scrambling[146]"
  24. 120 forj=1tol:wl$(j)=mid$(w$,j,1):next
  25. 125 forj=1tol:ri(j)=0:next:gosub320:gosub345:forj=1tol
  26. 130 i=int(rnd(0)*l)+1
  27. 135 forc=1toj:ifri(c)=ithenc=j:nextc:goto130
  28. 140 nextc:ri(j)=i:nextj
  29. 145 sw$="":forj=1tol:sw$=sw$+wl$(ri(j)):next:ifsw$=w$then125
  30. 150 gosub455:gosub485:c=(38-l)/2
  31. 155 print""tab(c);:print"[221]";sw$;"[221]"
  32. 160 printtab(c)"[173]";
  33. 165 forj=1tol:print"[195]";:next:print"[189]"
  34. 170 printtab(c)"[221]";
  35. 175 forj=1tol:print"[209]";:next:print"[221]"
  36. 180 printtab(c)"[173]";
  37. 185 forj=1tol:print"[195]";:next:print"[189]"
  38. 190 e=0:forn=1tol
  39. 195 print"   select letter for position no.";n;""
  40. 200 getl$:ifl$=""then200
  41. 205 print""tab(19)""l$"[146]"
  42. 210 ifl$=wl$(n)then225
  43. 215 e=e+1:gosub320:gosub355:print"number of flubs =";e;""
  44. 220 goto195
  45. 225 forj=1tol:ifri(j)=ntheni=j:j=l:next:goto235
  46. 230 next
  47. 235 gosub320:gosub325
  48. 240 sl$=left$(sw$,i-1):sr$=right$(sw$,l-i):sw$=sl$+"[209]"+sr$
  49. 245 print"":printtab(c)"[221]";sw$;"[221]"
  50. 250 print"";:printtab(c)"[221]";
  51. 255 forj=1ton:printwl$(j);:next:next
  52. 260 print"                                        "
  53. 265 ws=ws-50*e:b=(l-e)*25:ifb<0thenb=0
  54. 270 sc=sc+ws+b:print"word score =";ws+b;""
  55. 275 ps(yy-1)=sc:gosub490
  56. 280 print""tab(7)"type return to continue!
  57. 285 [161]a$:[139]a$[178]""[167]285
  58. 290 [139]a$[179][177][199](13)[167]285
  59. 295 [141]455:[130]y,z
  60. 300 [141]455:[141]340:[141]495
  61. 305 [153]"play again? (y/n)";:[133]a$
  62. 310 [139]a$[178]"y"[167][156]:[137]10
  63. 315 [153]"load":[128]
  64. 320 [141]340:[151]si[170]24,15:[142]
  65. 325 [151]si[170]5,12:[151]si[170]6,9
  66. 330 kp[178]kp[172](kp[179]10)[172]([171]1)[170]1:[151]si[170]1,kp[172]1.5[170]kp:[151]si[170]15,19[170]kp:[151]si[170]4,21
  67. 335 [129]q[178]1[164]5:[151]si,q[172]25:[130]:[142]
  68. 340 [129]r[178]si[164]si[170]24:[151]r,0:[130]:[142]
  69. 345 [151]si[170]5,50:[129]x[178]1[164]50:[151]si[170]1,[187](x)[172]32[170]50:[151]si[170]4,17
  70. 350 [129]a[178]1[164]10:[130]:[151]si[170]4,16:[130]:[142]
  71. 355 [151]si[170]6,240:[151]si[170]4,17:[129]a[178]1[164]10:[129]x[178]1[164]255[169]25:[151]si[170]1,x:[130]:[130]
  72. 360 [151]si[170]4,32:[142]
  73. 365 [153]"";
  74. 370 w$[178]"":cc%[178]0
  75. 375 [141]440:[139]a$[178][199](13)[167][142]
  76. 380 [139]a$[178][199](34)[167]375
  77. 385 [139]a$[179][199](32)[167]375
  78. 390 [139]a$[177][199](127)[167]375
  79. 395 [137]435
  80. 400 [141]440:[139]a$[178][199](13)[167][142]
  81. 405 [139]a$[178][199](20)[167]425
  82. 410 [139]a$[179][199](32)[176]a$[177][199](127)[167]400
  83. 415 [139]a$[178][199](34)[167]400
  84. 420 [137]435
  85. 425 cc%[178]cc%[171]1:[139]cc%[179]0[167]370
  86. 430 w$[178][200](w$,cc%):[153]"cmd cmd";:[137]400
  87. 435 [153]a$;:w$[178]w$[170]a$:cc%[178]cc%[170]1:[137]400
  88. 440 [153]" wait";:[129]j[178]0[164]50:[161]a$:[139]a$[179][177]""[167]j[178]50:[130]:[137]450
  89. 445 [130]:[153]"cmd cmd";:[129]j[178]0[164]50:[130]:[137]440
  90. 450 [153]"cmd cmd";:[142]
  91. 455 [153]"load"[163]12)"scrambled words"
  92. 460 [153][163]12)"usrusrusrusrusrusrusrusrusrusrusrusrusrusrusr":[142]
  93. 465 [153]"                                        ";:[142]
  94. 470 [129]j[178]1[164]l:wl$(j)[178][202](w$,j,1):[130]
  95. 475 r[178]0:[129]j[178]2[164]l:[139]wl$(1)[179][177]wl$(j)[167]j[178]l:[142]
  96. 480 [130]:r[178]1:[142]
  97. 485 [153]""n$(yy[171]1)"'s turn:"
  98. 490 [153]"score:"
  99. 495 [129]zz[178]0[164]pl[171]1:nn$[178]n$(zz):ll[178][195](nn$):[129]xx[178]ll[164]10:nn$[178]nn$[170]" ":[130]
  100. 500 [153]""nn$"wait "ps(zz)"":[130]
  101. 505 [153]"":[142]
  102.