- I am creating software, but now I do not want to publish its source code because I do not want people to steal my hard work. I'm not rude and nothing like that. The following is an example of what the program I am creating looks like.
print "Username : " name = gets.chomp print "Password : " pass = gets.chomp if name =="user" and pass=="pa$$word" print "Hello" else print "Error, incorrect details"
Now this is the simplest form of logging into Ruby, but what happens badly here when the user inserts the wrong information, the program just shuts down, and I want me to want the program to ask the user for the correct information while the right information is being inserted.
pause
So here is the code for ruby
a. print "Command : " b. command = gets.chomp c. if command == "Hello" d. print "Hi, how are you?" e. elsif command == "help" f. print "Say hi to me, chat with me"
now what i want here is also like the first question
Details: after the user enters "Hello", the program simply shuts down, but I want the program here to ask to send the line again.
source share