mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-21 23:00:43 -08:00
Merge pull request #617 from AnthonyMichaelTDM/patch-1
Update README of 60_mastermind
This commit is contained in:
@@ -19,6 +19,19 @@ Note that in this particular implementation, we never actually create a list of
|
||||
|
||||
At the beginning of this game, you input the number of colors and number of positions you wish to use (which will directly affect the number of combinations) and the number of rounds you wish to play. While you are playing as the code-breaker, you may type BOARD at any time to get a list of your previous guesses and clues, and QUIT to end the game. Note that this version uses string arrays, but this is merely for convenience and can easily be converted for a BASIC that has no string arrays as long as it has a MID$ function. This is because the string arrays are one-dimensional, never exceed a length greater than the number of positions and the elements never contain more than one character.
|
||||
|
||||
---
|
||||
### Implementation notes
|
||||
in [#613](https://github.com/coding-horror/basic-computer-games/pull/613)
|
||||
`1060 IF B1<>B OR W1<>W THEN I(X)=0`
|
||||
was changed to:
|
||||
`1060 IF B1>B OR W1>W THEN I(X)=0`
|
||||
This was done because of a bug:
|
||||
Originally, after guessing and getting feedback, the computer would look through every possible combination, and for all that haven't previously been marked as impossible it would check whether or not the black and white pins that that combination should get are not-equal to what its previous guess got and, if they are equal, the combination would be marked as possible, and if they aren't equal then the combination would be marked as impossible. This results in a bug where the computer eliminates the correct answer as a possible solution after the first guess, unless the first guess just happens to be correct.
|
||||
|
||||
this was discussed in more detail in [issue #611](https://github.com/coding-horror/basic-computer-games/issues/611)
|
||||
|
||||
additionally, it's recommended that you have the computer elimate it's previous guess as possible unless that guess was correct. (the rust port does this)
|
||||
|
||||
---
|
||||
|
||||
As published in Basic Computer Games (1978):
|
||||
|
||||
Reference in New Issue
Block a user