#include
#include
int iterator_1 = 0; //iterator for the cieling & floor
int iterator_2 = 0; //iterator for the walls
void plusminus() //Create the dashed floor and cieling
{
printf("+----+----+----+----+----+----+----+----+\n");
}
void blankbar() //Create the lined box's walls
{
printf("| | | | | | | | |\n");
}
int main(int argc, char** argv)
{
while(iterator_1 < 8) // Run it 8 times, only doing top to bottom
{
plusminus(); //Call plusminus to create the first cieling
++iterator_1;
while (iterator_2 < 3) //create the walls
{
blankbar();
++iterator_2;
}
iterator_2 = 0;
}
plusminus(); //creating the last floor
return 0;
}
Tuesday, August 3, 2010
8x8 grid quare in C
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment