Click here to Skip to main content
15,903,012 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: NT Services without threads Pin
ThatsAlok14-Sep-04 20:05
ThatsAlok14-Sep-04 20:05 
GeneralFree c++ compiler Pin
elfokab14-Sep-04 19:35
elfokab14-Sep-04 19:35 
GeneralRe: Free c++ compiler Pin
Anonymous14-Sep-04 20:02
Anonymous14-Sep-04 20:02 
GeneralRe: Free c++ compiler Pin
ThatsAlok14-Sep-04 20:06
ThatsAlok14-Sep-04 20:06 
GeneralRe: Free c++ compiler Pin
Maxime Labelle14-Sep-04 23:06
Maxime Labelle14-Sep-04 23:06 
GeneralRe: Free c++ compiler Pin
Ryan Binns14-Sep-04 23:09
Ryan Binns14-Sep-04 23:09 
GeneralRe: Free c++ compiler Pin
Henry miller15-Sep-04 4:07
Henry miller15-Sep-04 4:07 
Generalso confused! Pin
ISUstudent14-Sep-04 17:16
ISUstudent14-Sep-04 17:16 
Hey guys...How would I go about writing this in the .cpp file?

MOSTLY THE BOOL METHODS I AM HAVING TROUBLE WITH

This is what I have for the Menu.h file


#ifndef CONNECTFOUR_H
#define CONNECTFOUR_H
#include "Menu.h"//includes Menu header file

using namespace std;

class ConnectFour
{
private:
//date members
int board[12][13];
int numChips[7];


public:
ConnectFour();
//default constructor
bool playTurn();
/*gives a player the opportunity to place a chip into the board. This should be a Boolean function to return true if this turn produces a winner (otherwise false should be the return value).*/

void displayBoard();
/*places 2 different kinds of markers on the board (one for each player) and displays some kind of marker for empty slots. Be sure your choices are easy to see.
*/
void dropChip();
//places a chip into the board and looks for a winner

void checkWinner();
//should call 4 helper functions (you choose the names) to check the 4 possible winning moves – 4 in a row vertically, horizontally, or diagonally. These helper functions should look only at possible wins produced by this last move – they should not check the entire board!

void verticalwin();
//this method checks to see if 4 colors match to win the game vertically

void horizontalwin();
//this method checks to see if 4 colors match to win the game horizonatally

void diagonalwin1();
//this method checks to see if 4 colors match to win the game diagonally one way

void diagonalwin2();
//this method checks to see if 4 colors match to win the game diagonally the second way

bool determineDraw();
//method determines if the game is a draw (full board with no winner). This method returns true if the game is a draw and false if not.

};
#endif //ends ConnectFour.h



All I have left for my ConnectFour.cpp is ...



#include <iostream>
#include <string>
#include "ConnectFour.h"//includes ConnectFour header file

//default constructor will initialize zero to the data private members (variables)

ConnectFour::ConnectFour()
{
board[12][13] = 0;
numChips[7] = 0;

for(int i=0; i < 12; i++)
{
for(int j=0; j<13; j++)
{
board[i][j] = 0;
}
}

for(int i=0; i<7; i++)
{
numChips[i]= 0;
}
}

bool ConnectFour::playTurn()
{





}
GeneralRe: so confused! Pin
Hardy_Smith14-Sep-04 21:21
Hardy_Smith14-Sep-04 21:21 
GeneralRe: so confused! Pin
rotu15-Sep-04 17:41
rotu15-Sep-04 17:41 
Generalso confused! Pin
Anonymous14-Sep-04 17:14
Anonymous14-Sep-04 17:14 
GeneralRe: so confused! Pin
Arsalan Malik14-Sep-04 18:19
Arsalan Malik14-Sep-04 18:19 
GeneralAutomating the VC7 debugger Pin
Stephen Vivash14-Sep-04 16:49
Stephen Vivash14-Sep-04 16:49 
GeneralRe: This is ! Pin
Anonymous14-Sep-04 21:05
Anonymous14-Sep-04 21:05 
Generalabout domain Pin
yingkou14-Sep-04 14:44
yingkou14-Sep-04 14:44 
GeneralRe: about domain Pin
Ryan Binns14-Sep-04 18:14
Ryan Binns14-Sep-04 18:14 
GeneralRe: about domain Pin
yingkou14-Sep-04 18:40
yingkou14-Sep-04 18:40 
GeneralRe: about domain Pin
Ryan Binns14-Sep-04 22:57
Ryan Binns14-Sep-04 22:57 
Generalwin32 multi-threading Pin
stevieo8414-Sep-04 14:31
stevieo8414-Sep-04 14:31 
GeneralRe: win32 multi-threading Pin
CodyDaemon14-Sep-04 15:51
CodyDaemon14-Sep-04 15:51 
GeneralRe: win32 multi-threading Pin
stevieo8414-Sep-04 16:28
stevieo8414-Sep-04 16:28 
QuestionKBDLLHOOKSTRUCT error why? Pin
zubeido14-Sep-04 13:37
zubeido14-Sep-04 13:37 
AnswerRe: KBDLLHOOKSTRUCT error why? Pin
Anonymous14-Sep-04 15:46
Anonymous14-Sep-04 15:46 
AnswerRe: KBDLLHOOKSTRUCT error why? Pin
Blake Miller15-Sep-04 4:16
Blake Miller15-Sep-04 4:16 
GeneralPInvoke Context menus Pin
Jumpin' Jeff14-Sep-04 13:19
Jumpin' Jeff14-Sep-04 13:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.