mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-01 15:49:59 -08:00
Unfixes the fix introduced in a previous commit regarding how the computer deduces the answer. ReadMe updated with a thorough explanation of the deduction process.
This commit is contained in:
@@ -325,7 +325,7 @@ fn main() {
|
||||
if *b.1 { //filter out ones we already know aren't possible
|
||||
let mut tmp_guess = GUESS::new(CODE::new_from_int(b.0, num_colors, num_positions));
|
||||
tmp_guess.evaluate(&answer);
|
||||
if blacks > tmp_guess.blacks || whites > tmp_guess.whites { //if number of blacks/whites is different, set it to false
|
||||
if blacks != tmp_guess.blacks || whites != tmp_guess.whites { //if number of blacks/whites is different, set it to false
|
||||
*b.1 = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user