ambujraj / ambujraj/hacktoberfest2018
Create a MasterMind guessing game
- Lingua principale
- Python
- Stelle
- 140
- Fork
- 1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
We will write a version of MasterMind, which has two hints for a code breaker to break a secret code:
• the number of position (and digit) matches; and
• the number of remaining digit matches. The positions of these digits do not match.
In the process of determining the hints, each digit can be used once only. We need to ignore (or
remove) matched digits from the secret code and the guessed code before further checking. For
example, if the secret code is 0022 and the guessed code is 0241. The hint is "1 position match and 1
digit match". The digit with matched position is the first "0" (secret code becomes -022 and guessed
code becomes -241, where "-" represents an ignored digit) and the remaining digit match is "2" (secret
code now becomes -0-2 and guessed code becomes --41). If the guessed code is 2021 instead, the hint
is "2 position matches and 1 digit match" with the middle "02" as the matched positions and the digit
"2" as the matched digit.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.