Skip to content

Instantly share code, notes, and snippets.

@mukolweke
Last active October 17, 2015 09:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mukolweke/1165d1087f9b3f8f9dcb to your computer and use it in GitHub Desktop.
Save mukolweke/1165d1087f9b3f8f9dcb to your computer and use it in GitHub Desktop.
Ruby
answer = "kuku"
tries = 0
while tries <3
print("What's my nickname? ")
response=gets
response=response.chomp
tries += 1
if response == "kuku"
puts "That's right!!!"
exit
elsif tries ==3
puts "Sorry, The answer is kuku"
exit
else
puts "Sorry, try again. "
end
end
@mukolweke
Copy link
Author

want like a loop version with an array..rubitians help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment