Skip to content

Instantly share code, notes, and snippets.

Created April 5, 2012 01:38
Show Gist options
  • Save anonymous/2307257 to your computer and use it in GitHub Desktop.
Save anonymous/2307257 to your computer and use it in GitHub Desktop.
GOMOKO
#include <iostream>
using namespace std;
void board();
int main()
{
board();
}
void board()
{
cout << "What dimensions would you like for your board?\n" << "Width?"<<endl;
int width;
int height;
cin >> width;
cout << "Height?"<<endl;;
cin >> height;
char array[width][height];
int x = 1, y = 1;
while (y <= height)
{
while ( x <= width)
{
array[x][y] = '=';
cout << " | " << array[x][y];
x++;
}
cout << " | " << y << endl <<endl;
y++;
x = 1;
}
cout << " ";
while (x <= width)
{
cout << " "<< x << " ";
x++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment