mirror of
https://gitflic.ru/project/w0lf/bulls-and-cows-cpp.git
synced 2026-03-28 16:02:46 +03:00
Added the output of number of total steps at the end of game.
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
// CGame.cpp
|
// CGame.cpp
|
||||||
//
|
//
|
||||||
#include "CGame.h"
|
#include "CGame.h"
|
||||||
//#include <vector>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <cwctype>
|
#include <cwctype>
|
||||||
@@ -51,6 +50,7 @@ void CGame::Start()
|
|||||||
ret = GetNumber(step);
|
ret = GetNumber(step);
|
||||||
if (ret == -1) return;
|
if (ret == -1) return;
|
||||||
} while (ret < 0);
|
} while (ret < 0);
|
||||||
|
m_uStepCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintGameHeader();
|
PrintGameHeader();
|
||||||
@@ -85,7 +85,8 @@ void CGame::PrintGameHeader()
|
|||||||
|
|
||||||
void CGame::PrintGameFooter()
|
void CGame::PrintGameFooter()
|
||||||
{
|
{
|
||||||
std::wcout << L"\n\n\t" << L"!!! П О Б Е Д А !!!" << L"\n\n" << std::endl;
|
std::wcout << L"\n\n\t" << L"!!! П О Б Е Д А !!!" << std::endl;
|
||||||
|
std::wcout << L"\tКоличество ходов: " << m_uStepCounter << L"\n\n" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGame::PrintSteps()
|
void CGame::PrintSteps()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include "..\..\..\MyFunctions\SetUserLocale.h"
|
#include "..\..\..\MyFunctions\SetUserLocale.h"
|
||||||
#include "CGame.h"
|
#include "CGame.h"
|
||||||
#include <iostream>
|
//#include <iostream>
|
||||||
|
|
||||||
int wmain(int argc, wchar_t* argv[])
|
int wmain(int argc, wchar_t* argv[])
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user