Created
November 3, 2015 21:56
-
-
Save jminchew97/38b94ee200b3ded1223e to your computer and use it in GitHub Desktop.
Simple log in app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "Enter a Username" | |
user = gets.chomp | |
i = 0 | |
while user.length < 5 | |
puts "Username must be atleast 5 characters long." | |
user = gets.chomp | |
end | |
puts "please enter a password" | |
pass = gets.chomp | |
while pass.length < 5 | |
puts "Password must be atleast 5 characters long." | |
pass = gets.chomp | |
end | |
print "Sign up complete." | |
puts "Please log in!" | |
puts "Enter Username." | |
uname = gets.to_s | |
while uname != user | |
puts "Try your username again." | |
uname = gets.to_s | |
i + 1 | |
unless i == 5 | |
puts "nope." | |
end | |
end | |
puts "enter your password." | |
pword = gets.to_s |
line 3, 28-30 don't do anything.
i + 1 # doesn't do anything.
i += 1 # changes the i variable to be one more than it was.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
line 24: while loop isn't necessary. or the incrementor.