home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1987 May / 1987-05.d64 / unscramble.64 (.txt) < prev   
Commodore BASIC  |  2022-09-20  |  3KB  |  68 lines

  1. 10 poke53281,0:poke53280,6:co=54272:sc=1024:ndx=198:rem ndx=208 on the 128
  2. 20 pokeco+24,15:pokeco+5,17:pokeco+6,240:pokeco,100
  3. 30 x=rnd(-ti):dima$(40),b$(40),te(40)
  4. 40 for i=0 to 9:read nu$(i):next:data 00,01,02,03,04,05,06,07,08,09
  5. 50 for i=1 to 5:read ff$(i):next:data first,second,third,fourth,fifth
  6. 60 print"[147][158]":d$="                       "
  7. 70 printspc(14)"[155]unscramble":printspc(14)"[163][163][163][163][163][163][163][163][163][163]"
  8. 80 for i=0 to 1:print spc(11)"[154]player #"right$(nu$(i+1),1)"'s name"
  9. 90 printspc(11);:input p$(i):if p$(i)="" then print"[145][145]":goto90
  10. 100 p$(i)=left$(p$(i),10):next
  11. 110 print"[147]":pokendx,0:for i=1 to 5:w$(i)="":next
  12. 120 print"   [155]"p$(c)
  13. 130 for i=1 to 5
  14. 140 print"   [158]enter "ff$(i)"[146] word to be scrambled[146]"
  15. 150 print"   ";:inputw$(i):ifw$(i)=""thenprint"[145]";:goto150
  16. 160 w$(i)=left$(w$(i),15):forp=1tolen(w$(i))
  17. 170 ifmid$(w$(i),p,1)<"a"ormid$(w$(i),p,1)>"z"thenp=len(w$(i)):next:goto140
  18. 180 next:next:print"[155]         scrambling the words..."
  19. 190 gosub210:gosub330:gosub580
  20. 200 for i=1 to 10:b$(i)="":next:goto110
  21. 210 for i=1 to 5:r$(i)="":next:for mt=1 to 5:ups=len(w$(mt))
  22. 220 for i=1 to ups:te(i)=1:next
  23. 230 for i=1 to ups
  24. 240 xx=int(ups*rnd(1))+1:if te(xx)=0 then240
  25. 250 b$(i)=mid$(w$(mt),xx,1):te(xx)=0:next:r$(mt)=""
  26. 260 for i=1 to ups:r$(mt)=r$(mt)+b$(i)
  27. 270 next:if r$(mt)=w$(mt) and len(w$(mt))>1 then220
  28. 280 next
  29. 290 print"[147][145]         words are scrambled ":qq=-q+1:sp=len(p$(qq))+24:sp=sp/2
  30. 300 ps=19-sp:print spc(ps) p$(qq)", press any key to begin":gosub670
  31. 310 pokendx,0:waitndx,1:geta$
  32. 320 print"[147]":return
  33. 330 for mt=1 to 5:cs=-c+1:sp=int(len(p$(cs))/2)
  34. 340 ps=19-sp:print""spc(11)d$"":printspc(11)d$:printspc(11)d$
  35. 350 print""spc(ps)""p$(cs):sp=int(len(r$(mt))/2):ps=19-sp
  36. 360 print"[158]"spc(ps) r$(mt)
  37. 370 for j=1 to len(w$(mt)):a$(j)=mid$(w$(mt),j,1):next
  38. 380 z=sc+360+ps:cc=z+co:x=ps:for i=1 to len(w$(mt)):poke z,99:poke cc,1
  39. 390 get r$:tm=tm+.06:if int(tm)> 59 then mi=mi+1:tm=int(tm)-60
  40. 400 if mi>9 then tt$=str$(mi):mi$=right$(tt$,2):goto420
  41. 410 mi$=nu$(mi)
  42. 420 if tm>=10 then tt$=str$(int(tm)):tm$=right$(tt$,2):goto440
  43. 430 tm$=nu$(tm)
  44. 440 print""spc(17)"[158]word"mt
  45. 450 print"[155]"spc(17)mi$":"tm$:if r$="" then390
  46. 460 print""
  47. 470 if r$=a$(i) then print tab(x)a$(i);:pa=50:ups=50:gosub660:goto490:stop
  48. 480 tm=tm+10:pa=20:ups=120:gosub660:goto390
  49. 490 z=z+1:x=x+1:cc=cc+1:next:next mt:print:print"":q=-c+1
  50. 500 sp=len(p$(q))+19:sp=int(sp/2):ps=19-sp
  51. 510 print spc(ps)"[154]total time for "p$(q)"[146] was":sp=14:mi=val(mi$)
  52. 520 print spc(sp);:if mi>0 then print"[157][157][157][157][157]" mi"minute";
  53. 530 if mi>1 then print"s";
  54. 540 if mi>0 then print" and";
  55. 550 tm=val(tm$):print tm"second";:if tm>1 then print"s"
  56. 560 print""spc(17)"      "
  57. 570 for i=1 to 3000:next:so(q)=mi*100+tm:so$(q)=mi$+":"+tm$:tm=0:mi=0:return
  58. 580 ifc<>1thenc=1:return
  59. 590 print"[147][155]              final scores":print spc(14)"[163][163][163][163][163][163][163][163][163][163][163][163]"
  60. 600 printspc(11)p$(0)tab(23)so$(0):print""spc(11)p$(1)tab(23)so$(1)
  61. 610 print"":wn$=p$(0):if so(0)=so(1) then print spc(14)"it's  a tie":goto640
  62. 620 if so(1)<so(0) then wn$=p$(1)
  63. 630 print"           "wn$" is the winner"
  64. 640 print"       press any key to play again"
  65. 650 waitndx,1:geta$:run
  66. 660 poke co+1,pa:poke co+4,33:for qq=1 to ups:next:poke co+4,32:return
  67. 670 for pa=40 to 20 step-1:ups=20:gosub660:next:for i=1 to 500:next:return
  68.