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

C / C++ / MFC

 
GeneralRe: Drawing Controls Problem Pin
Shog916-Feb-02 16:25
sitebuilderShog916-Feb-02 16:25 
GeneralRe: Drawing Controls Problem Pin
John Clump16-Feb-02 18:00
John Clump16-Feb-02 18:00 
GeneralRe: Drawing Controls Problem Pin
Shog916-Feb-02 18:30
sitebuilderShog916-Feb-02 18:30 
GeneralRe: Drawing Controls Problem Pin
Ravi Bhavnani16-Feb-02 19:19
professionalRavi Bhavnani16-Feb-02 19:19 
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 
I did this for my Gr. 12 comp sci course last year, but in VB... Poke tongue | ;-P

It is your homework...

In anycase. This is what I did.

1) Create a dialog
2) Create (an array or not) of 9 Pushbutton controls and set the font accordingly, I used Arial Bold 23 Pts. This will let you focus on game logic, instead of x and o drawing.
3) Last create an array of 9 chars, NULL=Empty, X is X, Y is Y. This array will map to your physical buttons. this way you can disable the button once it was clicked and avoid having to double check the array to ensure someone hasn't chosen the same location twice.
4) On each buttonclick set the coresponding array element to X or Y depending on whos turn it is, then change the current buttons caption to the current elements value.
5) Design a killer AI, that of which will rival a Russian chess champion.

Tips: It'll be much easier to create the buttons statically and position them with dialog editor.

Tips: Each button click do the following!

1) Iterate array looking for X or O's horizontally
2) Iterate array looking for X or O's vertically
3) Iterate array looking for X or O's diagonally

If your test function returns TRUE you know someone has won the game!

BOOL IsWin()...???

your choice...from here on your on yer own...

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 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 
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 

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.