Click here to Skip to main content
15,922,407 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Drawing Controls Problem Pin
John Clump16-Feb-02 19:47
John Clump16-Feb-02 19:47 
GeneralHelp on Designing Tictactoe in VC++ Pin
John Cruz16-Feb-02 15:38
John Cruz16-Feb-02 15:38 
GeneralRe: Help on Designing Tictactoe in VC++ Pin
Shog916-Feb-02 16:18
sitebuilderShog916-Feb-02 16:18 
GeneralRe: Help on Designing Tictactoe in VC++ Pin
alex.barylski16-Feb-02 22:28
alex.barylski16-Feb-02 22:28 
GeneralRe: Help on Designing Tictactoe in VC++ Pin
John Cruz18-Feb-02 12:43
John Cruz18-Feb-02 12:43 
GeneralRe: Help on Designing Tictactoe in VC++ Pin
Christian Graus18-Feb-02 12:47
protectorChristian Graus18-Feb-02 12:47 
GeneralRe: Help on Designing Tictactoe in VC++ Pin
Andrew Peace18-Feb-02 13:09
Andrew Peace18-Feb-02 13:09 
GeneralRe: Help on Designing Tictactoe in VC++ Pin
alex.barylski18-Feb-02 14:49
alex.barylski18-Feb-02 14:49 
I'm pretty sure recursion for a function with as much code as AI would be over kill.

char gameBoard[9] = {0,0,0,
                     0,0,0,
                     0,0,0};

BOOL IsWin() const
{
  char Piece = 'X';  //Look for X's first

  ...BEGIN loop
  //Is there a horizontal win
  if(gameBoard[0] == Piece && gameBoard[1] == Piece && gameBoard[2] == Piece) return TRUE;
  if(gameBoard[3] == Piece && gameBoard[4] == Piece && gameBoard[5] == Piece) return TRUE;
  if(gameBoard[6] == Piece && gameBoard[7] == Piece && gameBoard[8] == Piece) return TRUE;

  //Is there a vertical win
  ...
  //Is there a diagonal win
  ...

  Piece = 'Y';  //Loop once more to test for Y's
  ...END loop

  return FALSE;
}


This is something like what I did

Cheers

"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
GeneralRe: Help on Designing Tictactoe in VC++ Pin
John Cruz19-Feb-02 1:19
John Cruz19-Feb-02 1:19 
GeneralRe: Help on Designing Tictactoe in VC++ Pin
Member 139425924-Dec-04 20:17
Member 139425924-Dec-04 20:17 
GeneralMDI - How do I set or activate a view Pin
RobJones16-Feb-02 14:29
RobJones16-Feb-02 14:29 
GeneralRe: MDI - How do I set or activate a view Pin
Derek Waters17-Feb-02 11:35
Derek Waters17-Feb-02 11:35 
GeneralRe: MDI - How do I set or activate a view Pin
RobJones17-Feb-02 12:22
RobJones17-Feb-02 12:22 
GeneralRe: MDI - How do I set or activate a view Pin
Derek Waters17-Feb-02 12:31
Derek Waters17-Feb-02 12:31 
GeneralRe: MDI - How do I set or activate a view Pin
RobJones17-Feb-02 12:38
RobJones17-Feb-02 12:38 
Questionhow to place files in win32 console application project? Pin
padgyx16-Feb-02 13:01
padgyx16-Feb-02 13:01 
AnswerRe: how to place files in win32 console application project? Pin
alex.barylski16-Feb-02 13:36
alex.barylski16-Feb-02 13:36 
QuestionDoubleClick in CComboBox with dropdown-style? Pin
Rybeck16-Feb-02 11:29
Rybeck16-Feb-02 11:29 
AnswerRe: DoubleClick in CComboBox with dropdown-style? Pin
Rybeck17-Feb-02 5:10
Rybeck17-Feb-02 5:10 
GeneralMFC control that works like VB's Image Control Pin
16-Feb-02 10:20
suss16-Feb-02 10:20 
GeneralRe: MFC control that works like VB's Image Control Pin
alex.barylski16-Feb-02 11:30
alex.barylski16-Feb-02 11:30 
GeneralRe: MFC control that works like VB's Image Control Pin
Shog916-Feb-02 14:22
sitebuilderShog916-Feb-02 14:22 
GeneralCFontDialog Pin
16-Feb-02 8:24
suss16-Feb-02 8:24 
GeneralRe: CFontDialog Pin
Joaquín M López Muñoz16-Feb-02 8:39
Joaquín M López Muñoz16-Feb-02 8:39 
GeneralRe: CFontDialog Pin
16-Feb-02 9:10
suss16-Feb-02 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.