Search⌘ K
AI Features

Challenge: Guess the Number

Explore how to program a number guessing game in Ruby where players guess a hidden number from a list. Learn to use conditional statements and loops for comparing guesses, handling repeated attempts, and giving feedback until the correct number is found or the game stops.

Problem statement

Write a simple game where the player must find a hidden number drawn from a collection of numbers like [12, 65, 87, 113, 1, 5].

  • When ...