Anagrammatic   (Model A)


This is a simple anagram jumbler. There are few things more infuriating than staring blankly at crossword" clues, unable to de-jumble the letters. This little program will hopefully get the old brain ticking again with some fresh ideas on how to unscramble the problem.

   10 MODE7
   20 PRINTCHR$141;CHR$&83;SPC(12)"ANAGRAMMAT
IC"'CHR$141;CHR$&83;SPC(12)"ANAGRAMMATIC"
   30 PRINT''"If you are a crossword solver ,
 then youwill know the problems of trying to 
    rearrange letters."''"Follow the instruct
ions and then sit    back and watch the scree
n as every      possible combination runs up 
before your";
   40 PRINT"very eyes.The aim is not to lokk 
at     every word,but simply glance at the   
  screen occasionally and you may well getsom
e inspiration."
   50 PRINT'''CHR$136"      Press any key to 
start."
   60 X=GET
   70 FORI=3TO24:PRINTTAB(0,I)CHR$&84;CHR$157
;CHR$&86;:NEXT:VDU28,3,24,39,3,12,28,3,24,36,
3
   80 PRINT''"Enter the letters to be rearran
ged(Max 10)"
   90 INPUTTAB(0,4)A$:IFA$=""GOTO90
  100 L=LEN(A$)
  110 PRINT''"Are any letters/spaces known (Y
/N)"
  120 Z$=GET$
  130 IFZ$="N" GOTO220
  140 IFZ$<>"Y" GOTO120
  150 PRINT''"Type in the known order as per 
   example."'"E.g. '---D-F- -EE'"
  160 INPUTTAB(0,15)K$:W=L
  170 T=0:FORJ=1 TOLEN(K$):IFMID$(K$,J,1)="-"
 T=T+1
  180   FORI=1TOL:IFMID$(K$,J,1)=MID$(A$,I,1)
 T=T+1:I=L
  190   NEXT
  200 NEXTJ:IFT<>L GOSUB390:GOTO160
  210 GOTO230
  220 K$=STRING$(L,"-")
  230 C$="":FORI=1TOLEN(A$)
  240   IFMID$(K$,I,1)<>MID$(A$,I,1) C$=C$+MI
D$(A$,I,1)
  250 NEXT
  260 K=LEN(C$):DIMQ(K)
  270 FORI=1TOK:Q(I)=I:NEXT:Q(K)=K-1
  280 H=K
  290 Q(H)=Q(H)+1:IFQ(H)=K+1 Q(H)=1:H=H-1:GOT
O290
  300 IFH=0 GOTO380
  310 F=1:FORI=1TOK:FORJ=1TOK:IFQ(J)=Q(I) AND
 J<>I F=0
  320   NEXT,:IFF=0 GOTO280
  330   J=1:PRINTTAB(13);
  340   FORH=1TOLEN(K$)
  350     IFMID$(K$,H,1)="-" PRINTMID$(C$,Q(J
),1);:J=J+1 ELSE PRINTMID$(K$,H,1);
  360   NEXTH:PRINT
  370   GOTO280
  380   PRINT''"That's all the combinations."
'"Press any key for more":CLEAR:GOTO60
  390   PRINT'CHR$136;CHR$&81"ERROR-retype.":
RETURN