Jump to content




Better Password Tutorial



  • You cannot reply to this topic
4 replies to this topic

#1 Alice

  • Members
  • 429 posts
  • LocationBehind you.

Posted 18 November 2013 - 10:16 AM

After viewing a few posts about passwords, I felt the need to do this.
I will be explaining every line of code.
local os.pullEvent = os.pullEventRaw --Localize to make sure pullEvent in other programs works.
local password --This declares the password variable in a local environment so no one can steal it using other programs.
print("Please enter your password:") --writes a line asking the user to print their password
while read("*")~=password then --Repeat this until the user types in the password
print("Incorrect password") --Writes a line telling the user the password is incorrect
sleep(2) --Give the user time to read the text
term.clear() term.setCursorPos(1,1) --Clears the screen, sets the cursor to the default position, like the clear program
print("PLease enter your password:") --Same as above
end --Stops the script
--Now you should be able to be done.


#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 18 November 2013 - 06:46 PM

This is definitely not a "better password tutorial", its not even a tutorial. You need way more content and you need to explain how a lot of things better. Heavily commented code is difficult to read, so split those up and have paragraphs before and/or after the code snippets, then provide a "final" together solution.

You also have a bug on the very first line of your code! That is not very tutorial like! local os.pullEvent = os.pullEventRaw you can't localise a variable that you're putting into a non-local table. The rule that applies the most when writing tutorials as well as submitting any program is to test your code!

#3 Symmetryc

  • Members
  • 434 posts

Posted 18 November 2013 - 07:32 PM

View Posttheoriginalbit, on 18 November 2013 - 06:46 PM, said:

This is definitely not a "better password tutorial", its not even a tutorial. You need way more content and you need to explain how a lot of things better. Heavily commented code is difficult to read, so split those up and have paragraphs before and/or after the code snippets, then provide a "final" together solution.

You also have a bug on the very first line of your code! That is not very tutorial like! local os.pullEvent = os.pullEventRaw you can't localise a variable that you're putting into a non-local table. The rule that applies the most when writing tutorials as well as submitting any program is to test your code!
We need a Tutorial Tutorial ._.

Edited by Symmetryc, 18 November 2013 - 07:32 PM.


#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 18 November 2013 - 11:08 PM

View PostSymmetryc, on 18 November 2013 - 07:32 PM, said:

We need a Tutorial Tutorial ._.
We really do, it is starting to become ridiculous with the amount of bad tutorials.

#5 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 18 November 2013 - 11:32 PM

Moved to Ask a Pro.





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users