• C

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.
cooldeanAsked:
Who is Participating?
 
trifusionCommented:
0
 
trifusionCommented:
Palm apps are almost all only in C, here is a good starting point:

http://freshmeat.net/projects/coconutfern/

Greg
0
 
cooldeanAuthor Commented:
How do I see the code though?
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
SethHoytCommented:
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
0
 
cooldeanAuthor Commented:
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.  
0
 
SethHoytCommented:
"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:

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


-Seth
0
 
cooldeanAuthor Commented:
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.


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.