REM Anagram Game REM Richard Weston REM 3rd March 2003 MODE8 DIM A(20),word$(100) score=0 i=0 REPEAT i=i+1 READ word$(i) UNTIL word$(i)="*" nwords=i-1 : PROCshufflewords : FOR n= 1 TO nwords word$=word$(n) PROCanagram NEXT n END : DEF PROCanagram REPEAT CLS COLOUR15 PRINTTAB(1,1)"A N A G R A M G A M E"' COLOUR9 PRINTTAB(1)"Just press if you need to give up!"' COLOUR14 PRINTTAB(1)"Question ";n;" of ";nwords; COLOUR15 PRINT" Score = ";score;" " ' FOR z=1 TO 14 PROCnewanagram COLOUR RND(7) PRINTTAB(1+(z-1)*5) B$ NEXT COLOUR7 ON INPUT''TAB(20)"are anagrams of : "guess$ OFF IF guess$ = word$ THEN PRINT'TAB(38)"Right!" score+=1 ENDIF IF guess$<>word$ THEN IF guess$ ="" THEN COLOUR17 PRINT'TAB(38,VPOS-2)word$ ELSE PRINT'TAB(38)"Try again!" ENDIF ENDIF delay=INKEY(100) UNTIL guess$ = word$ OR guess$="" ENDPROC : DEF PROCshufflewords FOR i = nwords TO 2 STEP -1 x=RND(i) temp$=word$(x) word$(x)=word$(i) word$(i)=temp$ NEXT i ENDPROC : DEF PROCnewanagram L=LEN(word$) B$="" FOR i= 1 TO L A(i)=i NEXT FOR i = L TO 2 STEP -1 x=RND(i) temp=A(x) A(x)=A(i) A(i)=temp NEXT i FOR i= 1 TO L B$=B$+MID$(word$,A(i),1) NEXT i ENDPROC : DATA banana, apple, carrot, aerial, parrot, gorilla, thistle, house DATA wrong, right, rabid, angry, comet, program, dictator, meteorite, rifle DATA computer, wrist, cranium, brain, nerve, spoof, sunshine, planet, satellite DATA soapy, green, yellow, elephant, haircut, scissors, mouse, photograph, scanner DATA aspirin, delight, happiness, victory, peace, femur, bliss, heaven, nirvana DATA ankle, kneecap, elbow, aardvark, abacus, enzyme, protein, nucleus, electron DATA positron, dinosaur, extinct, mantra, pigsty, temple, ziggurat, windmill DATA haddock, plaice, lobster, miniskirt, teacher, professor, diamond, zircon DATA criminal, judge, adjective, organ, violin, banjo, tempo, ballet, sextet DATA vocalist, clarinet, virtuoso, guitar, saxaphone, quartet, magician, spaniel DATA cabbage, broccoli, drought, tractor, haystack, telescope, asteroid, supernova : REM: Don't delete the following asterisk - its the end marker DATA *