I'm not sure what is wrong with it but when i enter cetain coordinates it puts X's on multipul squares.I am pretty new to programming so go easy on me.
T.c
tictactoe.h
This is a discussion on Need help with tictactoe game(C) within the Game Programming forums, part of the General Programming Boards category; I'm not sure what is wrong with it but when i enter cetain coordinates it puts X's on multipul squares.I ...
I'm not sure what is wrong with it but when i enter cetain coordinates it puts X's on multipul squares.I am pretty new to programming so go easy on me.
T.c
tictactoe.h
- Your if statements are wrong, you probably meant to use "==".
- Don't put function bodies in the header file
- Don't capitalize function names, that's standard for macros.
- Find a new way to check for winner. Your "if" statements took up eight wrapping lines on a standard 80-character window.
- You're declaring a global board[3][3] in both files, and they are different variables. Learn how to pass variables, and declare it in main.
- You aren't error checking. If someone enters 4, it'll go out of bounds and probably crash.
- You're using flaggy code, and that's poor style.
Fix these things, and we can help you with the actual issue.
Thank you for you answer. I didn't realize that I had a single equals sign in my if statement.