02-20-2007, 11:18 AM
Inspired by the movie War Games:
Code:
'' compile with fbc version
dim target as string = "Hello, world!"
dim matches(0 to len(target) - 1) as integer
dim numMatches as integer = 0
dim test as string = space(13)
randomize timer
cls
do
dim i as integer
for i = 0 to len(target) - 1
if not matches(i) then
do
test[i] = int(rnd * 256)
loop while test[i] < 32
if test[i] = target[i] then
matches(i) = -1
numMatches += 1
end if
end if
next
locate 1,1 : print test : sleep 50
if numMatches = len(target) then exit do
loop
stylin: