Post main image

rb_number_guessing_game_v0

Simply number guessing game (Ruby)

#8 Project of the Week

puts "This game was created by: Michael Crowley" puts "Guess a number from 1 to 10" secret_num = "2" guess = "" guess_count = 0 guess_limit = 3 out_of_guesses = false while guess != secret_num and !out_of_guesses if guess_count < guess_limit puts "Enter guess: " guess = gets.chomp() guess_count += 1 puts hint = "number is between 1 and 3" else out_of_guesses = true end guess_count += 1 end if out_of_guesses puts "You Lose!" else puts "You Win!" end

Screenshots
Project screenshot 1
Comment post

Skip straight to final coding interviews with
Remote Companies!

Top Makers

Most active posts

Top projects