Connect4ProgramHELP

//I have been assigned a project that requires me to make a connect four game.
//It must be a 2 player game and each player must be able to enter in their 'pieces'. When player one enters in a position on the board(2 dimensional array) that position will be assigned the character 'G'. Vice versa for player 2 but they will enter in a 'x' in the position they enter from the keyboard.
board starts out looking like
Terminal:
*******
*******
*******
*******
*******
*******
//6x7 board
Example with players.
Enter in position player 1: 0,2
Enter in position player 2: 6,0
**G****
*******
*******
*******
*******
X******



//Here is my code thus far, but I am receiving the error; 'ID returned 1 exit status' in dev++ compiler.
//Please help locate any possible errors.Thanks
#include <iostream>
using namespace std;
int main()
{
char ary[6][7];
for(int i=0;i<6;i++)
{
cout<<endl;
for(int j=0;j<7;j++)
{
ary[i][j]='*';
cout<<ary[i][j];

}
}


int y=0;
int x=0;
int a=0;
while(a < 42)
{
for(; x<42;x++)
{

cout<<"Enter in a position player 1";
cin>>ary[x][y];
ary[x][y]='G';
cout<<ary[x][y];

for(int i=0;i<6;i++)
{
cout<<endl;
for(int j=0;j<7;j++)
{
cout<<ary[6][7];
}
break;
}

for(; y<42; y++)
{
cout<<"Enter in positon player 2";


cin>>ary[x][y];

ary[x][y]='X';

cout<<ary[x][y];

for(int i=0;i<6;i++)
{
cout<<endl;
for(int j=0;j<7;j++)
{
cout<<ary[6][7];
}


break;
}
}


a++;
}
}
}
Have you played Connect4? You can't place a piece at (0,2). You place a piece in a column and it drops to the bottom. You have described an extended noughts and crosses game.


Please use the code format tags to format your code.
Topic archived. No new replies allowed.