Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Connect4 Game

Posted on 2003-10-29
7
Medium Priority
?
358 Views
Last Modified: 2010-04-15
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.
0
Comment
Question by:cooldean
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 

Assisted Solution

by:trifusion
trifusion earned 1000 total points
ID: 9643949
Palm apps are almost all only in C, here is a good starting point:

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

Greg
0
 

Author Comment

by:cooldean
ID: 9646116
How do I see the code though?
0
 
LVL 5

Expert Comment

by:SethHoyt
ID: 9646554
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:cooldean
ID: 9647239
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
 
LVL 5

Expert Comment

by:SethHoyt
ID: 9647412
"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
 

Author Comment

by:cooldean
ID: 9647487
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
 

Accepted Solution

by:
trifusion earned 1000 total points
ID: 9647673
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question