home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 71 / 071.d81 / bytes (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  2KB  |  85 lines

  1. 8 poke53281,0:poke53280,2
  2. 10 printchr$(142)"[147]     the mighty loadstar permutizer"
  3. 12 printtab(12)"[154](e[154])co algorithm
  4. 14 [153][163]12)"(jcont)ohannsen algorithm
  5. 16 printtab(12)"(b[154])ack to loadstar"
  6. 18 getz$:ifz$<>"e"andz$<>"j"andz$<>"b"then18
  7. 20 ifz$="b"then310
  8. 22 print"      while the list is scrolling:"
  9. 24 print"       shift[154] - pause   cmdr[154] - end"
  10. 28 printtab(11)"[145][145][159]your word:     [157][157][157][157]";:l9%=6:gosub50000:a$=q9$
  11. 30 l=len(a$):ifl<3thenprint"[145][145]":goto28
  12. 32 print"[155]":ti$="000000"
  13. 34 ifz$="j"then500
  14. 37 :
  15. 38 :rem    *** eco algorithm ***
  16. 39 :
  17. 40 fori=1tol:b$(i)=mid$(a$,i,1):next
  18. 50 t=0:fori1=1tol:e(1)=i1
  19. 60 fori2=1tol:e(2)=i2
  20. 70 ifi1=i2then260
  21. 80 ifl=3then180
  22. 90 fori3=1tol:e(3)=i3
  23. 100 forj=1to2:ife(3)=e(j)thenj=2:next:goto250
  24. 110 next:ifl=4then180
  25. 120 fori4=1tol:e(4)=i4
  26. 130 forj=1to3:ife(4)=e(j)thenj=3:next:goto240
  27. 140 next:ifl=5then180
  28. 150 fori5=1tol:e(5)=i5
  29. 160 forj=1to4:ife(5)=e(j)thenj=4:next:goto230
  30. 170 next
  31. 180 f=0:g=0:form=1tol-1:f=f+e(m):next
  32. 190 fork=1tol:g=g+k:next:rem could be       g=(l*(l/2)+l/2)
  33. 200 e(l)=g-f
  34. 210 t=t+1:printt,;:fork=1tol:printb$(e(k));:next:print
  35. 220 ifpeek(653)=1then220
  36. 225 ifpeek(653)=2thenclr:goto10
  37. 230 ifl>5thennexti5
  38. 240 ifl>4thennexti4
  39. 250 ifl>3thennexti3
  40. 260 nexti2
  41. 270 nexti1
  42. 277 :
  43. 278 :rem    *** prompt for more ***
  44. 279 :
  45. 280 printtab(15)"[154]time: [158]"mid$(ti$,4,1)":"right$(ti$,2)
  46. 285 printtab(14)"[154]again? (y[154]/n[154])"
  47. 290 geta$:ifa$<>"y"anda$<>"n"then290
  48. 300 ifa$="n"then10
  49. 305 goto22
  50. 307 :
  51. 308 :rem    *** back to loadstar ***
  52. 309 :
  53. 310 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  54. 320 ifer<>63then end
  55. 330 print"[147][144]load"chr$(34)"hello connect"chr$(34)",8"
  56. 340 print"run"
  57. 350 poke631,13:poke632,13:poke198,2:end
  58. 500 b$=mid$(a$,1,1):c$=mid$(a$,2,1):d$=mid$(a$,3,1)
  59. 505 e$=mid$(a$,4,1):f$=mid$(a$,5,1):g$=mid$(a$,6,1)
  60. 507 t=0
  61. 510 onlen(a$)gosub570,560,550,540,530,520:goto280
  62. 520 fori=1to6:gosub530:h$=g$:g$=f$:f$=e$:e$=d$:d$=c$:c$=b$:b$=h$:next:return
  63. 530 forj=1to5:gosub540:h$=f$:f$=e$:e$=d$:d$=c$:c$=b$:b$=h$:next:return
  64. 540 fork=1to4:gosub550:h$=e$:e$=d$:d$=c$:c$=b$:b$=h$:next:return
  65. 550 forl=1to3:gosub560:h$=d$:d$=c$:c$=b$:b$=h$:next:return
  66. 560 t=t+1:printt,b$c$d$e$f$g$:t=t+1:printt,c$b$d$e$f$g$:goto580
  67. 570 t=t+1:printt,b$c$d$e$f$g$
  68. 580 ifpeek(653)=1then580
  69. 590 ifpeek(653)=2thenclr:goto10
  70. 595 return
  71. 10000 open15,8,15,"i0":print#15,"s0:bytes":close15:save"bytes",8:end
  72. 49997 :
  73. 49998 :rem   *** input routine ***
  74. 49999 :
  75. 50000 q9$="":u9=53280:poke198,0
  76. 50010 geta$
  77. 50020 poke646,rnd(1)*15+1:print"[164][157]";
  78. 50025 ifa$=""then50010
  79. 50030 ifa$=chr$(13)thenprint" ":return
  80. 50040 if(a$=chr$(20)andlen(q9$))thenq9$=left$(q9$,len(q9$)-1):goto50080
  81. 50050 iflen(q9$)>=l9%thent9%=peek(u9):pokeu9,1:pokeu9,t9%:goto50010
  82. 50060 ifa$<" "or(a$>chr$(127)anda$<chr$(160))ora$=chr$(34)then50010
  83. 50070 q9$=q9$+a$
  84. 50080 print""a$;:goto50010
  85.