Link to home
Start Free TrialLog in
Avatar of cooldean
cooldean

asked on

Connect4 Game

How do you code a Connect4 game?

-two players (represented each by a special symbol, i.e. 1 for player 1 or 2 for player 2 and 0 for empty entries)
-fixed size 8 by 8 table
-using a 2D array but 1D array to keep track of most bottom empty entry of each column in the board
-have a function that checks if a winning occurs after a specific player made a specific move. It must take the 2D array representing the board, player making the move, and the coordinates of that move( column: given by you as input, and row: generated automatically) as arguments
-have four constants TABLESIZE, PL1, PL2 and EMPTY.  #define them properly and they have to be used throughout the code

Since I'm just learning C language, I would appreciate it if there is no use of advanced C language so I can understand it.  Basically, this is to help me out in understanding Arrays.

Thanks alot in advance.  Hope to hear from you guys on what you think.
SOLUTION
Avatar of trifusion
trifusion

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cooldean
cooldean

ASKER

How do I see the code though?
cooldean,

Please stop asking people to solve homework-type problems for you. You really need to try to do some of it yourself, then others can help to correct your errors and give you additional direction.

Try to do part of it, like setting up the main function, etc. then we can help you further.

-Seth
First of all, everyone who posts here knows to give hints and not completey solve the problem.  

Second, what does it matter if it is homework or not.  If you answer questions on here, you get the points.  Who cares if that person uses it for homework, throws it to the garbage, or shows it to the President of the United States?  

Third, no one is forcing anyone to answer questions.  If you want to answer the question, answer it.  If not, then don't.  

And finally, I have set up the main functions.  I ask it on here to 1) move on from the main function and/or 2) see what I'm missing.


Anyways, back to the problem...a Connect4 game.  
"Second, what does it matter if it is homework or not."

It is against EE policy to solve homework problems or to ask for solutions to them. See here:

https://www.experts-exchange.com/help/member.jsp#12
https://www.experts-exchange.com/help/mistakes.jsp#7


-Seth
Like I said, people who post here direct you to the solution.

The policy is fine with that:

:What you CAN do is guide an asker through the process of figuring out their homework. To put it at its most ridiculously sublime: You can teach a person to count, but don't tell him that 2 + 2 = 4. "

Anyways, I don't want to get in a debate with you.  All I'm asking for is help on coding a Connect4 game.  I'm not asking anyone to write the entire code for me, but just to guide me in writing the main parts for it.


ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial