Skip to content

aolamide/number-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

number-game

A fun to play number game.

This game is usually played with 4 digits, but can also be played with 3 or any other number of digits. We'd be using 4 digits in this game.

At the beginning, a 4-digit number is secretely picked by the computer. The digits would be all different. Then, you try to guess the computer's number, and the number of matches is shown to you. If the matching digits are in their right positions, they are "dead", if in different positions, they are "wounded".

Example:

  • Secret number: 4271
  • Your try: 1234
  • Answer: 1 dead and 2 wounded. (The dead is "2", the wounded are "4" and "1".)
  • Secret number: 4271
  • Your try: 2140
  • Answer: 0 dead and 3 wounded. (No number in right position, the wounded are "4", "1" and "2".)
  • Secret number: 4271
  • Your try: 4271
  • Answer: 4 dead and 0 wounded. (All numbers are correct and in right positions). You win the game if you achieve this within 7 guesses
You must correctly give the computer's secret number in the right order within 7 guesses to win the game.
Basic Tips :
  • All four digits are different
  • Number cannot begin with 0
Goodluck. 👍

Releases

No releases published

Packages

No packages published