wargis
04-25-2004, 02:26 PM
g'day peoples,
im new to these forums and to the coding world so be nice. :o
using c++ here, ive got to draw a grid 9x9 and place a star in the middle. I can draw the grid, but the bloody star keeps appearing at the bottom, heres my code, thx for the help.
-----
#include <iostream.h>
void main ()
{
int column=0;
int row=0;
int x=5;
int y=5;
for (column=0; column <9;column ++)
{int column=0;
for (row=0; row <19; row ++)
cout <<"-"; cout << endl;
for (row=0; row <10; row++)
cout << "| ";
cout << endl;}
for (row=0; row <19; row ++)
cout <<"-"; cout << endl;
for (int row=0; row <19; ++row)
{cout <<endl;
for (int column=0; column <10; ++column)
if ((column==x)&&(row==y))
cout <<"?";
else
cout <<"*";
}
return;
}
im new to these forums and to the coding world so be nice. :o
using c++ here, ive got to draw a grid 9x9 and place a star in the middle. I can draw the grid, but the bloody star keeps appearing at the bottom, heres my code, thx for the help.
-----
#include <iostream.h>
void main ()
{
int column=0;
int row=0;
int x=5;
int y=5;
for (column=0; column <9;column ++)
{int column=0;
for (row=0; row <19; row ++)
cout <<"-"; cout << endl;
for (row=0; row <10; row++)
cout << "| ";
cout << endl;}
for (row=0; row <19; row ++)
cout <<"-"; cout << endl;
for (int row=0; row <19; ++row)
{cout <<endl;
for (int column=0; column <10; ++column)
if ((column==x)&&(row==y))
cout <<"?";
else
cout <<"*";
}
return;
}