aarondandy / two-dollar-ideas

2 stars 0 forks source link

Number guessing game #15

Open aarondandy opened 6 years ago

aarondandy commented 6 years ago

The goal is to create a simple game where the computer selects a number randomly and the player must guess what number the computer selected.

The basic implementation of the game starts with the computer selecting a random number and keeping that number to itself as a secret. The user then gets a number of attempts (20?) to guess the number the computer is holding as a secret.

After each guess either the player is told they guessed the number correctly, or they are given a clue about the number. The most common clue given in implementations is if the number guessed is higher than or lower than the secret number.

Options for some creativity may include adding other clues, such as if the number is divisible by 8 or a riddle about the secret number.

This project should teach the user some basics of flow control involving, loops and if.

Buildstarted commented 6 years ago

Typically you only need 6 attempts with the higher/lower clues for 1-100. (i think the real search space is 1-243?) with 7 guesses your search space becomes 1-2186...

aarondandy commented 6 years ago

This also may set the stage for binary search, or some kind of thinking about partitioning data