This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
UP844's profile picture

Password

Started by UP844, 21 July 2013 - 11:10 AM
UP844 #1
Posted 21 July 2013 - 01:10 PM
I'm making a program that once you enter 3 passwords it kills everyone. Apocalypse program type thing. Basically I was using just 3 while loops with a single password, but then of course I forgot that if you get the password right it just asks you again. What else could I do instead of 3 single passwords in a row like I've been doing.
albrat #2
Posted 21 July 2013 - 01:46 PM
like a self destruct confirmation ?

in reality a self destruct would collect the two command codes, then activate the destruct. So I would guess collecting the three passwords at once would be the best way to go. eg.


passa = "nuke"
passb = "them"
passc = "all"

print("input instadeath code 1 : ")
codea = read ("*") -- * instead of chars shown - lets make it look command codey
print("Code 2 : ")
codeb = read("*")
print("Code 3 : ")
codec = read("*")
if codea == passa and codeb == passb and  codec == passc then
-- nuke them all code!!!!
end

os.shutdown()  -- we might as well kill the computer too.