>> any one can help me with code pleas
Yes, start here
int main()
{
// put your code here
}
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
MFC is a horribly badly designed and unreliable library, never ever use this.
Those are fighting-words Mr. :) But MFC is C++, not C so its not relevent to this board and this thread.
>>And better don't rely on windows api, because microsoft tends to change its api, in windows vista it's not any more the same as in the descendants of windows nt, and this change is most likely not the last
You obviously have no clue what you are talking about. Win32 api in Vista is the same as previous versions of MS-Windows -- onlyenhanced and some additions.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
@tahnan
First write some code which say displays the current board, as outlined in your previous posts.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
ok let me try another way
_o__|_x_|_x__
_x__|_o_|_x__
_x__|_x_|_o__
| |
This is the game i wanted to make
I think everyone over the age of 5 years old knows what tick-tack-toe games are like. I think others here have given you hints how to write the program. No one is going to do your homework for you, so post code and ask questions about how to resolve specific problems.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Like I said
1. Write a function which draws the board.
2. Add code to place a 'X' or 'O' at any valid position on the board. Having placed a piece, use the drawBoard() function from step 1.
The computer for it's part plays "dumb" and just picks any vacant position at random.
3. Add code which checks the board for a winning line. If someone has won, then announce the winner.
4. Add things like instructions and repeated play.
5. Replace the computer random play with something which is a bit smarter.
6. Update the board display to use either a better console interface like curses, or go for a more graphical display based on MFC/GTK/whatever else is flavour of the month.
7. Add sounds.
8. Add head-to-head network play.
9. Add win/loss statistics.
10. Refine the computer AI play with difficulty levels so that players of varying skill can all have a challenging game.
It is an iterative process. Show that you can make some progress on step 1 then we can help you.
If you try to do the whole thing in one step, then you'll fail.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Here is the source code to a workable program.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Thus proving once again that if you nag long enough and play dumb then someone will eventually post a link just to keep the noise down :(
It really depends whether you really want to learn this stuff, in which case you'll make an attempt to solve it yourself, or whether you just want to get a "right-click-save-as" qualification.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
You keep talking, but I don't see any code.
You're certainly not going to learn how to code simply by looking at other peoples code and reading some books. You've got to get down to it and try some stuff for yourself.
I've outlined a progression. How far you want to go along that in the time available is entirely up to you. But since you have only a week then I'd say it's down to the computer making only random moves, and just the basic "drawBoard()" and "checkForWin()" functions on your part.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953