diff --git a/game.cpp b/game.cpp index 150792d..9004b0f 100644 --- a/game.cpp +++ b/game.cpp @@ -43,8 +43,8 @@ class Game { this->count++; if (num == answer) return true; - if (num > answer) this->upper = num; - else if (num < answer) this->lower = num; + if (num > answer && num < this->upper) this->upper = num; + else if (num < answer && num > this->lower) this->lower = num; return false; }