T
tomakated
How do I get rid of the dashes next to the 3, 6, and the 9<?.
Also the last row of "------" and the "|" on the last line so that the
board will look like this<?.
| |
| |
1| 2| 3
--------------------
| |
| |
4| 5| 6
--------------------
| |
| |
7| 8| 9
and not this
| |
| |
1| 2| 3|
--------------------
| |
| |
4| 5| 6|
--------------------
| |
| |
7| 8| 9|
--------------------
| |
Can anyone Help<?>
#include <iostream>
#include <iomanip>
void tttboard (int,int) ;
void printboard (int,int) ;
void lineofdashes() ;
void linewithnumbers(int, int) ;
void linewithoutnumbers();
const int Boxwidth = 6;
const int Boxheight = 4;
int main()
{
tttboard (1,9) ;
}
void tttboard (int start, int numberofcells)
{
int first;
first = start;
while (first<=numberofcells)
{
printboard (first, numberofcells);
first = first+3;
}
linewithoutnumbers();
}
void printweek (int first, int numberofcells)
{
int i;
linewithoutnumbers ();
linewithoutnumbers ();
linewithnumbers (first, numberofcells);
for (i=0; i<Boxheight-3; i++)
lineofdashes ();
}
void lineofdashes()
{
int i;
for (i=0; i<3*Boxwidth + 2; i++)
cout << "-";
cout << endl;
}
void linewithoutnumbers()
{
int i;
for (i=0; i<2; i++)
cout << setw(Boxwidth+1) << "|";
cout << endl;
}
void linewithnumbers (int first, int numberofcells)
{
int i, cellnumber;
cellnumber = first;
for (i=0; i<3; i++)
{
if ((cellnumber >0) && (cellnumber <= numberofcells))
cout << setw(Boxwidth) << boxnumber << "|";
else cout << setw(Boxwidth) << boxnumber << endl;
cellnumber ++;
}
cout << endl;
}
"calendar.cpp" 72 lines, 1189 characters
$ calendar.out
| |
| |
1| 2| 3|
Also the last row of "------" and the "|" on the last line so that the
board will look like this<?.
| |
| |
1| 2| 3
--------------------
| |
| |
4| 5| 6
--------------------
| |
| |
7| 8| 9
and not this
| |
| |
1| 2| 3|
--------------------
| |
| |
4| 5| 6|
--------------------
| |
| |
7| 8| 9|
--------------------
| |
Can anyone Help<?>
#include <iostream>
#include <iomanip>
void tttboard (int,int) ;
void printboard (int,int) ;
void lineofdashes() ;
void linewithnumbers(int, int) ;
void linewithoutnumbers();
const int Boxwidth = 6;
const int Boxheight = 4;
int main()
{
tttboard (1,9) ;
}
void tttboard (int start, int numberofcells)
{
int first;
first = start;
while (first<=numberofcells)
{
printboard (first, numberofcells);
first = first+3;
}
linewithoutnumbers();
}
void printweek (int first, int numberofcells)
{
int i;
linewithoutnumbers ();
linewithoutnumbers ();
linewithnumbers (first, numberofcells);
for (i=0; i<Boxheight-3; i++)
lineofdashes ();
}
void lineofdashes()
{
int i;
for (i=0; i<3*Boxwidth + 2; i++)
cout << "-";
cout << endl;
}
void linewithoutnumbers()
{
int i;
for (i=0; i<2; i++)
cout << setw(Boxwidth+1) << "|";
cout << endl;
}
void linewithnumbers (int first, int numberofcells)
{
int i, cellnumber;
cellnumber = first;
for (i=0; i<3; i++)
{
if ((cellnumber >0) && (cellnumber <= numberofcells))
cout << setw(Boxwidth) << boxnumber << "|";
else cout << setw(Boxwidth) << boxnumber << endl;
cellnumber ++;
}
cout << endl;
}
"calendar.cpp" 72 lines, 1189 characters
$ calendar.out
| |
| |
1| 2| 3|