diff --git a/bulls-and-cows-cpp/CGame.cpp b/bulls-and-cows-cpp/CGame.cpp index ff4e6ff..75ff901 100644 --- a/bulls-and-cows-cpp/CGame.cpp +++ b/bulls-and-cows-cpp/CGame.cpp @@ -7,8 +7,9 @@ #include #include -void CGame::Init() +void CGame::Init(int digits) { + m_ucDigits = digits; m_fGameIsEnd = false; m_ucBulls = 0; m_ucCows = 0; @@ -146,8 +147,3 @@ bool CGame::IsEqual(int n, int j) } return result; } - -CGame::CGame(int d) -{ - m_ucDigits = d; -} diff --git a/bulls-and-cows-cpp/CGame.h b/bulls-and-cows-cpp/CGame.h index 031161f..b1ccd4a 100644 --- a/bulls-and-cows-cpp/CGame.h +++ b/bulls-and-cows-cpp/CGame.h @@ -24,8 +24,6 @@ private: void PrintSteps(); public: - void Init(); + void Init(int); void Start(); - - CGame(int); }; diff --git a/bulls-and-cows-cpp/CStep.cpp b/bulls-and-cows-cpp/CStep.cpp index 6010b20..85cec22 100644 --- a/bulls-and-cows-cpp/CStep.cpp +++ b/bulls-and-cows-cpp/CStep.cpp @@ -39,7 +39,3 @@ std::pair CStep::GetStepAnimals() { return m_uStepAnimals; } - -CStep::CStep() -{ -} diff --git a/bulls-and-cows-cpp/CStep.h b/bulls-and-cows-cpp/CStep.h index 471272d..9d7308b 100644 --- a/bulls-and-cows-cpp/CStep.h +++ b/bulls-and-cows-cpp/CStep.h @@ -14,5 +14,4 @@ public: void CheckForAnimals(const int*, int); std::vector GetStepNumber(); std::pair GetStepAnimals(); - CStep(); }; diff --git a/bulls-and-cows-cpp/bulls-and-cows.cpp b/bulls-and-cows-cpp/bulls-and-cows.cpp index facb4f4..13376e1 100644 --- a/bulls-and-cows-cpp/bulls-and-cows.cpp +++ b/bulls-and-cows-cpp/bulls-and-cows.cpp @@ -9,8 +9,9 @@ int wmain(int argc, wchar_t* argv[]) { if (!SetUserLocale()) return 1; - CGame game(4); - game.Init(); + CGame game; + + game.Init(4); game.Start(); return 0;