Hey i recently got set a project to design a c++ connect four (four in a row) program on the console or using GUI. It only has to be Human vs Human, which is prolly sumthing a lot of you hav seen or done b4. I draw a blank with c++, iv no idea where or how to start, let alone write full code for it.

They say i hav 2 make use of at least one class in the project. Has ANYONE got ANYTHING that cud help me?

Yes, just follow this link:
http://www.daniweb.com/techtalkforums/announcement8-2.html

In this case, if you really have no idea where to start, I suggest you first at least try to write out what your program is supposed to do. For a rather simple program such as this, you can easily decompose the game into its components, and then you can think about how you can implement the components using classes.

Things to ask yourself:

How is connect four played?
Is there 'gravity'? IE, will you only have an option of dropping checkers in at four places, or is this a 4x4 game of tic-tac-toe?

What else does a connect four board do besides hold checkers?

I won't code it for you, none of us will, but if you answer those questions, I'll help you with the socratic method until you start seeing what you can do to code this program. The choice of GUI or console is up to you.
If you're not familiar with a graphics package or development environment (such as Visual Studio), then I reccomend you do this in a console.

hey thanks for the reply, i really dint want any1 2 do the problem 4 me, just give me a starting point in terms of layout and use of functions and stuff. I decided to do it in the console, and am using a 7x6 2D integer array to represent the board, with a prompt asking the player to enter the colum no. after which the board is redrawn. i was also thinking about using colours to differentiate between the zero's as opposed to an IF or CASE to add in letters representing pieces.

Its going to be a simple 'four in a row' type of game, and im trying to get a class to deal with the selected column ie. position on the board, is it a winning piece, are there too many pieces in the column or in play and things like that.

I know that if im being set this task then maybe there are others out there who might have done it as well, im NOT asking for code, just asking how you went about it: what class(es), functions etc did u use.

Thanks for the help.

Just think: How could your problem be made easier? If you had a built in utility that does [something useful], you'd be able to write this program easily, right? And you'd surely have an easier time it had a member function that [gives some useful information about the ____]. You need to think in this fashion.

Giving you the datatype organization and member functions is basically doing the problem for you -- the actual implementation is a triviality. You need to think harder and longer, and if you can't design the whole thing at once, work on some small part of the problem that you know will be useful.

hey am bak, went and rly tried to get it don, my main prblem is just that i cant absorb c++ rules and syntax well, but this is how far i have gotten with ur advice:

got the console to print a 7x6 grid
2 users can enter column no and the co-ordinates on the grid will change to a 1 aftr the grid reprints
the board checks if 2 many pieces are on the board

im stuck now again in that i want both player 1 and 2's counters to be 0's, but different colours, but i dnt know how to get the 2d array to get the chosen co-ord to be a certain colour.

Any help wud be appreciated greatly as i think that different colours of 0's look more like actual counters than 1' and 2's. thnx

C++ knows nothing about color. You will need graphics program of some sort in addition to the C++ code to change the color. You can probably do this through Windows API using Console functions, but you could surely do it with a full fledged graphics program. If you aren't learning the basics of C++ real well you will undoubtedly have trouble understanding a graphics interface. I'd stick to using ASCI characters as the display until you've got a little more experience under your belt.

hi...............will anyone be able to suggest how to implement four in a row game in VC++

It is BAD FORM to bring a thread that is over 3 years old back to life.

If you have a problem, you might follow the suggestions in the thread to get started. Once you've made some progress, start your own thread.

For homework or assignment type problems, we expect you to do most of the work. We much prefer that you post your code (or a part of it) with comments and questions like "I expected it to do ___ but it is doing ___" or "I tried __ and __ but can't seem to get it to do ___"

Demonstrate that you're putting effort in and the level of help you get will improve significantly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.