Simple Word Letter Randomizer Program

Simple example how to mess letters of words. I use FreeBASIC authors names here. This program messes letters order and asks can you figure out whos name is messed.

' wanabe stuff first ;D
' www.ascii-world.com

SCREEN 13 : Color 15,0
Randomize Timer

DIM Word2(23) AS STRING ' All authors mentioned on credits

' authors at Word2()
For i = 1 TO 23
READ Word2(i)
DATA "Andre Victor"
DATA "Angelo Mottola"
DATA "Daniel R. Verkamp"
DATA "Mark Junker"
DATA "Antoni Gual"
DATA "Bryan Stoeberl"
DATA "Chris Davies"
DATA "Dumbledore"
DATA "Edmond Leung"
DATA "Eric Lope"
DATA "Fabio Rodella"
DATA "fsw"
DATA "Garvan O'Keeffe"
DATA "Jean Debord"
DATA "Jofers"
DATA "Marzec"
DATA "Matthias Faust"
DATA "Nek"
DATA "plasma"
DATA "Randy Keeling"
DATA "Sterling Christensen"
DATA "Steven Hidy"
DATA "zydon"
NEXT i

DIM Auth AS INTEGER ' number of randomed author
Auth = INT(RND * 23 + 1)

DIM Word(LEN(Word2(Auth))) AS STRING ' DIMs Word as lenght of author name

' messes letters order and prints on screen
COLOR 14,0
For i = 1 TO LEN(Word2(Auth))
DO
x = INT(RND * LEN(Word2(Auth)) + 1)
Loop Until Word(x) = ""
Word(x) = MID$(Word2(Auth),x,1) : LOCATE 10 , (20 - INT(LEN(Word2(Auth)) / 2) + i) : Print Word(x);
Next i

' good old basic
COLOR 2,0
Quest$ = "Who is this?" : LOCATE 8 , 20 - INT(LEN(Quest$) / 2) : Print Quest$
LOCATE 12 , 20 - INT(LEN(Word2(Auth)) / 2) : INPUT Guess$

CLS ' green if correct, red if not
IF Guess$ = Word2(Auth) Then COLOR 2
IF Guess$ <> Word2(Auth) Then COLOR 6
LOCATE 10 , 20 - INT(LEN(Word2(Auth)) / 2) : Print Word2(Auth);

SLEEP
END
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.