- Dav
Code: Select all
'4pass.txt
'A simple 4 digit password entry method.
'Can hide password while typing.
'Coded by Dav, SEP/2015
graphics
graphics clear
set buttons custom
set buttons font size 56
draw font size 56
draw text "Enter code.." at 200,56
draw font size 300
password$="0000" '<<< your password here
showpass=0 '<<< set 0 to show * instead
draw color 0,0,0
for t =0 to 9
button t text t at 60+(t*60), 400
next t
count=0
do
for t =0 to 9
if button_pressed(str$(t)) then
count=count+1
pass$=pass$&str$(t)
graphics clear
if showpass=1 then
draw text pass$ at 10,100
else
'draw text "*" at 10,100
draw text string$(count,"*") at 10,100
end if
end if
next t
until count=4
for t =0 to 9 ! button t delete ! next t
graphics clear
draw font size 56
if pass$<>password$ then
draw text "WRONG!" at 300,56
else
draw text "RIGHT!" at 300,56
end if
def string$(num, a$)
b$=""
for g=1 to num
b$=b$&a$
next g
return b$
end def