10 REM "ALFSHUF" - One liner alphabet shuffle. 20 REM J.Davis '94 30 MODE7:VDU23,1,0,0;0;0;0; 40 PRINTTAB(10);CHR$(141);CHR$(131);"Alphabet Shuffle" 50 PRINTTAB(10);CHR$(141);CHR$(131);"Alphabet Shuffle" 60 PRINTCHR$(145);STRING$(39,"s") 70 PRINT" This is a one-liner. I was trying to crack an anagram by getting the Beeb toshuffle letters randomly, using a simple program which continuously took a letter from a random position and put"; 80 PRINT"it at the beginning. This produced a very surreal movement, with the letterson the left shuffling rapidly to the right, gradually slowing down to nothing at the right end. The longer" 90 PRINT"the word, the wierder the effect, so this program uses the whole alphabet. Ithen wondered if the program could be squeezed down into a one-liner." 100 PRINT" For direct control, press ESCAPE, then use Space Bar for movement." 110 PRINT:PRINTTAB(27);"PRESS SPACE" 120 PRINTCHR$(145);STRING$(39,"s") 130 G=GET 140 ONERROR GOTO200 150 REM "The one line 160 MODE7:PROCMandW:VDU23,1,0;0;0;0;:A$="ABCDEFGHIJKLMNOPQRSTUVWXYZ":REPEAT:R=RND(25)+1:B$=MID$(A$,R,1):A$=B$+LEFT$(A$,R-1)+RIGHT$(A$,26-R):PRINTTAB(5,10);CHR$(141);"";A$:PRINTTAB(5,11);CHR$(141);"";A$:UNTILFALSE 170 DEFPROCMandW 180 PRINTTAB(6,22);"What do you think of it so far..." 190 ENDPROC 200 ONERROR GOTO250 210 MODE7:PROCz:VDU23,1,0;0;0;0;:A$="ABCDEFGHIJKLMNOPQRSTUVWXYZ":REPEAT:PRINTTAB(5,10);CHR$(141);"";A$:PRINTTAB(5,11);CHR$(141);"";A$:G=GET:R=RND(25)+1:B$=MID$(A$,R,1):A$=B$+LEFT$(A$,R-1)+RIGHT$(A$,26-R):UNTILFALSE 220 DEFPROCz 230 PRINTTAB(6,22);"Press or hold Space Bar. ESCAPE for statistics." 240 ENDPROC 250 ONERROR GOTO140 260 MODE7:VDU23,1,0;0;0;0; 270 PRINT" Starting each time with a fresh alphabet, this counts the number of times the letter 'A' manages to get to the right hand end." 280 PRINT:PRINTCHR$(145);STRING$(39,"s") 290 PRINTTAB(6,22);"Toggle T for fast/slow. ESCAPE for first display." 300 F=0:S=0:FL=1 310 A$="ABCDEFGHIJKLMNOPQRSTUVWXYZ" 320 R=RND(25)+1:B$=MID$(A$,R,1):A$=B$+LEFT$(A$,R-1)+RIGHT$(A$,26-R) 330 PRINTTAB(5,10);CHR$(141);"";A$:PRINTTAB(5,11);CHR$(141);"";A$ 340 IF RIGHT$(A$,1)="A" THEN S=S+1:PRINTTAB(23,15);"TO END:";S:FORN=1TO3000:NEXT:GOTO310 350 IFB$="A" THEN F=F+1:PRINTTAB(6,15);"NOT TO END:";F:GOTO310 360 X$=INKEY$(0) 370 IFX$="T" THEN FL=FL*-1 380 IFFL=-1 THEN FORN=1TO500:NEXT 390 GOTO320