Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: typedef explanation needed Pin
Michael Dunn2-Oct-03 17:43
sitebuilderMichael Dunn2-Oct-03 17:43 
GeneralRe: typedef explanation needed Pin
Steve Messer2-Oct-03 18:28
Steve Messer2-Oct-03 18:28 
GeneralRe: typedef explanation needed Pin
Michael Dunn2-Oct-03 18:47
sitebuilderMichael Dunn2-Oct-03 18:47 
GeneralRe: typedef explanation needed Pin
Steve Messer2-Oct-03 19:24
Steve Messer2-Oct-03 19:24 
GeneralHelp in a simple game Pin
Snyp2-Oct-03 15:52
Snyp2-Oct-03 15:52 
GeneralRe: Help in a simple game Pin
Maxwell Chen2-Oct-03 16:31
Maxwell Chen2-Oct-03 16:31 
GeneralRe: Help in a simple game Pin
Snyp3-Oct-03 16:18
Snyp3-Oct-03 16:18 
GeneralRe: Help in a simple game Pin
spiritualfields2-Oct-03 18:20
spiritualfields2-Oct-03 18:20 
I'm assuming that what you want is the computer to play tic tac toe against a human, with the human being the x's. I'm not into A.I, but you can do this by brute force, since it's only tic tac toe with so many possible combinations. There are eight ways that the computer can win, and 8 ways that a human can win, for a total of sixteen winning combinations (3 vertical rows, 3 horizontal rows, and the two diagnols for each of the players). When it is the computer's turn, check all of the combinations for a win. If there is not immediate win, then check all of the human's combinations for a win and block it. Your check() function would have to be modified. What I would do, say for checking the computer for a win, is count the number of o's per combination, with the only possible counts being 0, 1, or 2. Save the combinations that don't have x's. This will be used for the computer's move, once it's determined that the human doesn't have a pending win forcing the computer to block. Now check all the combinations again, this time for x's to see if the human has a pending win that the computer must block. If there were 2 x's in a combination with a blank, then the computer would have to put an o in the blank to block the human's win. If the player didn't have a pending win, then go back to the saved combinations for the computer and programatically determine the best move, based on the counts in the combinations of o's. This is brute force, but with careful maniupulation, this would get the computer playing a human.

Ed
GeneralRe: Help in a simple game Pin
Snyp3-Oct-03 16:17
Snyp3-Oct-03 16:17 
GeneralTaskbar Text Pin
skallestad2-Oct-03 14:51
skallestad2-Oct-03 14:51 
GeneralRe: Taskbar Text Pin
Jagadeesh VN3-Oct-03 1:40
Jagadeesh VN3-Oct-03 1:40 
QuestionWhat version of Crystal Report have we got in VS.Net? Pin
Link26002-Oct-03 13:30
Link26002-Oct-03 13:30 
GeneralReally bizarre problem Pin
Joel Holdsworth2-Oct-03 12:55
Joel Holdsworth2-Oct-03 12:55 
GeneralRe: Really bizarre problem Pin
Tim Smith2-Oct-03 13:03
Tim Smith2-Oct-03 13:03 
GeneralRe: Really bizarre problem Pin
Joel Holdsworth2-Oct-03 13:07
Joel Holdsworth2-Oct-03 13:07 
GeneralCFont size Pin
@LX2-Oct-03 12:14
@LX2-Oct-03 12:14 
GeneralRe: CFont size Pin
alex.barylski2-Oct-03 17:14
alex.barylski2-Oct-03 17:14 
GeneralRe: CFont size Pin
@LX3-Oct-03 10:38
@LX3-Oct-03 10:38 
QuestionHow do I unload ActiveXObject in IE Pin
pbonner2-Oct-03 12:12
pbonner2-Oct-03 12:12 
AnswerRe: How do I unload ActiveXObject in IE Pin
igor19603-Oct-03 8:31
igor19603-Oct-03 8:31 
GeneralSpecify items to step over when using F11 in VC Pin
Grailman2-Oct-03 9:09
Grailman2-Oct-03 9:09 
GeneralRe: Specify items to step over when using F11 in VC Pin
vcplusplus2-Oct-03 10:44
vcplusplus2-Oct-03 10:44 
GeneralRe: Specify items to step over when using F11 in VC Pin
Grailman2-Oct-03 12:24
Grailman2-Oct-03 12:24 
GeneralRe: Specify items to step over when using F11 in VC Pin
vcplusplus2-Oct-03 14:24
vcplusplus2-Oct-03 14:24 
GeneralDetecting fastcall Pin
Gisle Vanem2-Oct-03 8:55
Gisle Vanem2-Oct-03 8:55 

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.