Added computer move highliting
This commit is contained in:
parent
98ccb35b2a
commit
7b7097f1d6
@ -7,6 +7,7 @@ CTicTacToeApp app;
|
|||||||
BOOL CTicTacToeApp::InitInstance()
|
BOOL CTicTacToeApp::InitInstance()
|
||||||
{
|
{
|
||||||
CTicTacToeDlg* dlg = new CTicTacToeDlg();
|
CTicTacToeDlg* dlg = new CTicTacToeDlg();
|
||||||
|
m_pMainWnd = dlg;
|
||||||
|
|
||||||
dlg->DoModal();
|
dlg->DoModal();
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
<PlatformToolset>v143</PlatformToolset>
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
@ -136,7 +137,7 @@
|
|||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
@ -50,6 +50,9 @@ void CTicTacToeDlg::OnBnClickedSquare(UINT nID)
|
|||||||
UINT comp_id = findComputerMove();
|
UINT comp_id = findComputerMove();
|
||||||
playerMove(comp_id);
|
playerMove(comp_id);
|
||||||
buttons[comp_id].SetWindowTextW(L"O");
|
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)) {
|
if (checkWin(SqState::O)) {
|
||||||
ended = TRUE;
|
ended = TRUE;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
class CTicTacToeDlg : public CDialog, public TicTacToeGame {
|
class CTicTacToeDlg : public CDialog, public TicTacToeGame {
|
||||||
public:
|
public:
|
||||||
CTicTacToeDlg() : CDialog(IDD_TIC_TAC_TOE_DIALOG, NULL) {};
|
CTicTacToeDlg() : CDialog(IDD_TIC_TAC_TOE_DIALOG) {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnOK();
|
void OnOK();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user