I know you guys saw my old tic tac toe, here is the new one. Please comment on my code. Here is a text file with the source code, i use msvc++ 6.
I know you guys saw my old tic tac toe, here is the new one. Please comment on my code. Here is a text file with the source code, i use msvc++ 6.
Hi,
I looked at your first attempt. It's good to see that you changed the input to 1-9 instead of two coordinates. I feel that is much better). I also noticed on the original that the players name did not print out properly but does now - I could not see why it did not print before (I am new to C).
The only comment I would have is that playing the latest version does not display very well, I find the numbers on the display (which are helping to tell you which key to press) do not look as good as the "-" before. A way around this might be to print the grid with the numbers at the top of each game rather than on the "real" board.
Just small comments - otherwise great.
Well Done!!
Nice game. I see that yo uchanged a few things from the first one. When you get better or just feel like it, try using ASCII characters to create a more authentic board, then as your skills develop even more, you could really turn it into a high quality game. Anyway though! Good job!
PS- i got beat alot by the 'insane' AI
Kuplex
"The only thing you can count on is uncertainty."
Must I explain myself futher?
Only one big problem...
Global Variables... ack...
Why not use global variables? Simple. Global variables remain on the stack for the entire duration of the program. Incredibly inefficient.
Other than that, the codes great!
-Vulcan
Well...it seems to work but:
- its no c++ its c. If you'd use a class you'd also get rid of this
crappy global vars...
- the code can be improved at _several_ points (if conditions, switch *brr*)
- the system() commands aren't very nice in my oppinion
- try makin' the code full ANSI, always better
- the computermove() functions is hardcoded. That suxx Try using an array of single bits indicating ur own markers and the enemy markers and perform logical actions on these arrays...
but anyway: well done
aloa
cody
#include "reallife.h"
good program, my only suggestion is to try to find a way to randomize the computer moves somewhat in insane, because once you find a way to win, you can keep using the exact same moves.
whats wrong with system() commands?- the system() commands aren't very nice in my oppinion
They are ugly There's always another way to do it without a system() command.
arigato
cody
#include "reallife.h"
If you're fairly smart, you should get a tie every time.Originally posted by Kuplex
PS- i got beat alot by the 'insane' AI
:P
I followed an old thread on a TicTacToe game of yours; and I tried to make my own, but failed.. I tried again a few weeks later and my result is attached. It sounds fairly similar to yours; but instead of coding an AI i've decided to take a try at connect 4.
Last edited by Dual-Catfish; 12-10-2001 at 06:36 PM.
Err, can't attach file to an edited message; here it is.
.
Kuplex
"The only thing you can count on is uncertainty."
Must I explain myself futher?