'Completely Automatic Public Turing test to tell Computers and Humans Apart
'first, we gather the size of the CAPTCHA
input "What will be the width (max 300)"; width
input "What will be the height (max 300)"; height
input "What will be the font"; fnt$
input "What will be the size"; size
input "What will be the word"; captcha$
'check if there are any errors in the size
if width < 1 then goto [error]
if height < 1 then goto [error]
if width > 300 then goto [outSize]
if height > 300 then goto [outSize]
print "Generating CAPTCHA of " ;width; " wide by " ;height; " high:"
graphic #CAPTCHA, width, height
#CAPTCHA size(1) 'pen size one
'loop through the width and height, setting a random color
for y = 0 to height - 1
for x = 0 to width - 1
color = int(rnd(1)*2) + 1
if color = 1 then #CAPTCHA color(0,0,0)
if color = 2 then #CAPTCHA color(255,255,255)
#CAPTCHA place(5,(size + 10))
print "Problem with sizing. Did you use numbers? Did you generate numbers greater than 0?"
print "That's too large! Please keep it within 300x300 for the sake of the server!"
input "Try again (y/n)?"; try$
if try$ = "y" then [main]
if try$ = "n" then [End]
print "Say what? Please remember this is case-sensitive!"
print "Thanks for trying it out!"
help on how to format text