Posted 28 May 2014 - 08:17 PM
I made this program for basic experience using the Table API.
It is really easy to use and is pretty basic, it just uses tables to match the words typed.
If you typo, no problem, just type "erase", or whatever you set the keyword to.
pastebin get hT7dTus3 startup
Source Code :
It is really easy to use and is pretty basic, it just uses tables to match the words typed.
If you typo, no problem, just type "erase", or whatever you set the keyword to.
pastebin get hT7dTus3 startup
Source Code :
Spoiler
eraseKey = "erase" -- Key word for typos to erase everything typed.
password = {"pass", "word"} -- Multi word password.
-- Do not edit beyond this point, unless you know what you are doing and are trying to improve.
term.clear()
wordsTyped = { }
term.setCursorPos(1,1)
repeat
typed = read()
table.insert(wordsTyped, typed)
if typed == eraseKey then
for i=1, #wordsTyped do
table.remove(wordsTyped)
end
term.clear()
term.setCursorPos(1,1)
end
until table.concat(wordsTyped) == table.concat(password) and #wordsTyped == #password
term.clear()
term.setTextColor(colors.yellow)
term.setCursorPos(1,1)
term.write(os.version())
term.setCursorPos(1,2)
term.setTextColor(colors.white)