1 rem *** seQuence
2 relR
3 rem ***
I, rem ***
5 reM ***
6 rem ***
7 rem
50 dllR a$(26)
100 z$="abcdefghijklmnopqrstuvwxyz"
110 21$="12345678901234567890123456"
200 print"'~~enter length of string to be sequenced~"
220 Input "maximum length is 26 "~s%
230 if s%(1 or s%)26 then 200
240 s=s%
300 for i=1 to s
310 a$(i)=mid$(z$,i,l)
320 next i
400 rem randomize string
420 for 1=1 to s
430 k=int(rnd(I)*s+l)
440 t$=a$ ( I)
450 a$( i )=a$(k)
460 a$(k )=U
470 next i
480 Qosub 950
595 t=O
600 rem reverse substring
605 t=t+l
610 input "how many to reverse ";r%
620 if r%=O goto 900
630 if r%)O and r%(=s goto 650
640 print "must be between 1 and "IS: go to 610
650 r=int(r%/2)
660 for i=1 to r
670 U=a$( i)
680 a$(i)=a$(r%-i+l)
690 a$(r%-i+l)=t$
700 next i
750 gosub 950
800 c=l: for i=2 to s
810 if a$(i»a$(i-l) goto 830
820 c=O
830 ne>:t i
840 if c=O go to 600
850 print "~you did it in "it;" tries"
900 rem check for another game
910 input "~want to play again ";y$
920 if left$(y$,I)="y" or y$="ok" or y$="I" goto 200
930 end
950 print
960 print left$(zl$,s)
970 for 1=1 to s: print a$(i)~:next
980 print "~"
990 return
from pet user group
software exchange
po box 371
montgomeryville, pa 18936
This program courtesy of Gene Deals
146