Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dleedev365/numberbaseballgame
A 4-digit guessing game that adapts principlces of mastermind and baseball games
https://github.com/dleedev365/numberbaseballgame
mastermind terminal-game
Last synced: 10 days ago
JSON representation
A 4-digit guessing game that adapts principlces of mastermind and baseball games
- Host: GitHub
- URL: https://github.com/dleedev365/numberbaseballgame
- Owner: dleedev365
- Created: 2017-05-15T07:43:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-23T02:57:53.000Z (over 4 years ago)
- Last Synced: 2024-03-23T00:52:03.991Z (8 months ago)
- Topics: mastermind, terminal-game
- Language: C++
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NumberBaseballGame
It's kind of a guessing game, but it has a twist ! Do you want to try it out ?# Background
Back in high school, I used to play a number guessing game on a piece of paper with friends. This game I played with freidns was a bit different from how people intuitively know about number guessing games. No one knew where the game was originated from, but it was phenomenal in my childhood.# Rules
With a little twist of baseball game rules, players get to guess the number of computer which is of 4 digits (repetitive). A total number of 10 guesses is allowed and each time players take a guess, a condition is given in form of [ _ S _ B _ O ].
- S represents the number of strikes / 1 Strike means players guessed a correct dgit at correct location
- B represents the number of balls / 1 Ball means players guessed a correct digit at incorrect location
- O represents the number of outs 1 Out means players guessed an incorrect digit at incorrect location*The more Outs you have, the clearer computer's number be
# To help your understanding better , here's an example.
Supposed computer chose a number, 1234, and player takes his/her first guess as 5431.
1. The condition to be given is [ 1S 2B 1O ].
2. Because 134 are in the computer's number and the location of 3 matches with the user's guess.
- 1 Out results from 5 not being in the computer's number.# Demo