Unjumble

Developer(s): C. Inman
Date: 1983
Type: Program
Platform(s): ZX81, TS 1000

A helper for newspaper word jumbles. Enter the scrambled word; the program shuffles its letters at random in FAST mode and prints each new arrangement it finds. The screen stays blank until it fills, so for short words press BREAK to see the list, and CONT to go on. In 2K you can do at most five letters.

The editor added a word counter (lines 7, 355 and 357) that numbers each new arrangement, so you know when you have seen all of them: a word of n letters has n! arrangements, 120 for five letters. The download has both versions.

Published in Syntax December 1983 (Unjumble Word Games).

Related Articles

Program unscrambles any word.

Image Gallery

Source Code

   1 REM UNJUMBLE BY C.INMAN
   2 SLOW
   5 PRINT AT 10,5;"INPUT THE WORD TO BE"
   6 PRINT AT 11,9;"UNSCRAMBLED:"
  10 INPUT A$
  15 FAST
  16 CLS
  20 LET B=LEN A$
  25 DIM C$(200,B)
  30 DIM W$(B)
  40 FOR C=1 TO B
  50 LET W$(C)=A$(C)
  60 NEXT C
  95 LET R$=""
 100 LET R=INT (RND*B)+1
 110 IF W$(R)="/" THEN GOTO 100
 120 LET R$=R$+W$(R)
 130 IF LEN R$=B THEN GOTO 200
 140 LET W$(R)="/"
 150 GOTO 100
 200 GOSUB 300
 210 GOTO 40
 300 LET E=0
 320 LET E=E+1
 330 IF R$=C$(E) THEN RETURN
 340 IF CODE C$(E)<1 THEN LET C$(E)=R$
 350 IF C$(E)=R$ THEN PRINT C$(E);
 360 IF C$(E)=R$ THEN RETURN
 370 GOTO 320

   7 LET S=0
 355 IF C$(E)=R$ THEN LET S=S+1
 357 IF C$(E)=R$ THEN PRINT S

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.