Added computer move highliting

This commit is contained in:
Dmitriy Shishkov 2022-02-23 23:14:08 +03:00
parent 98ccb35b2a
commit 7b7097f1d6
4 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,7 @@ CTicTacToeApp app;
BOOL CTicTacToeApp::InitInstance()
{
CTicTacToeDlg* dlg = new CTicTacToeDlg();
m_pMainWnd = dlg;
dlg->DoModal();

View File

@ -52,6 +52,7 @@
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@ -136,7 +137,7 @@
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>

View File

@ -50,6 +50,9 @@ void CTicTacToeDlg::OnBnClickedSquare(UINT nID)
UINT comp_id = findComputerMove();
playerMove(comp_id);
buttons[comp_id].SetWindowTextW(L"O");
buttons[comp_id].SetFocus();
buttons[btn_id].SetButtonStyle(BS_FLAT);
buttons[comp_id].SetButtonStyle(BS_DEFPUSHBUTTON);
if (checkWin(SqState::O)) {
ended = TRUE;

View File

@ -7,7 +7,7 @@
class CTicTacToeDlg : public CDialog, public TicTacToeGame {
public:
CTicTacToeDlg() : CDialog(IDD_TIC_TAC_TOE_DIALOG, NULL) {};
CTicTacToeDlg() : CDialog(IDD_TIC_TAC_TOE_DIALOG) {};
private:
void OnOK();