Use a "For...Next" loop to check every possible character.
Also, post you code in a code snippet next time please, foe example:
`set up
a$=" ~!@@#$%^&*()_+QWERTYUIOP{}|ASDFGJHJKL:ZXCVBNM<>?`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./"
randomize timer()
hide mouse
sync on
set text font "Courier New"
set text size 14
`asks for string, or generates a random one
print "STRING CRACKING PROGRAM"
start:
print "Enter the string to guess (leave blank for random):"
input s$
e=len(s$)
if s$="" then input "How many characters should the random string be? ";e
if s$=""
for q=1 to e
s$=s$+mid$(a$,rnd(len(a$)));
next q
endif
`sets up array
dim r$(e)
`core
f=timer()
while w$<>s$
inc o
`randomly guesses letters, if they're correct, it keeps them
for a=1 to e
if r$(a)<>mid$(s$,a) then r$(a)=mid$(a$,rnd(len(a$)))
next a
w$=""
for a=1 to e
w$=w$+r$(a)
next a
cls
text 5,5,w$
text 5,25,s$
sync
endwhile
f=timer()-f
`prints the results
print
print
print
print
print "It took ";o;" tries and ";f/1000;" seconds to guess your string."
wait 2500
input "Again? ";g$
if g$="yes" then goto start

* The band, visit them at Dopearmy.com (Warning, foul language.)