Connect four game - Works and would like input
This game was originally a Tictactoe game if you couldn't tell already.
I know that there are things I could add to the game such as computer strategy instead of a random move, or perhaps a menu at the start. I posted this to get some input on what I have so far, so I just used the basics.
If anyone wants to comment on programming style it would help a lot.
* EDIT *
The code is in the post below. When I edited the code it no longer formatted it correctly so I opened a new post to have the proper formatting.
* EDIT *
The game can be easily converted to a tictactoe style by changing these constructor values to:
Code:
xMax = 3;
yMax = 3;
rowSize = 3;
droppieces = false;
The board can be resized as seen above. You may play the computer, another human, or watch the computer play the computer. Up to 9 players can play in any human / computer configuration.
For example, to have player 1 be human, player 2 be a computer, player 3 be human, and player 4 be a computer with player 3 starting:
Code:
numberPlayers = 4; // how many players?
player = 3; // who starts?
playerType[1] = 1; // player # 1 is human
playerType[2] = 0; // player # 2 is computer
playerType[3] = 1; // player # 3 is human
playerType[4] = 0; // player # 4 is computer
If you would like the computer to move for you press '-1', yes, it's a hack, but I just wanted to make sure it had that functionality for now.