Solved

Connect4 Game

Posted on 2003-10-29
7
319 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
  • 3
  • 2
  • 2
7 Comments
 

Assisted Solution

by:trifusion
trifusion earned 500 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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 500 total points
ID: 9647673
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now