well i have this scholl project on c++
i manage to create the x and y axis but my only problem is the graph it self
in this specific project not allowed to use any graph libraries or anything equivalent only 4 chars space,*,-,|
here is what i i did
void main()
{
int i = 1;
int x = 0;
int y = 0;
int k = 0;
char a;
const screen_length = 79;
const screen_height = 25;
const minx = 10;
const maxx = -10;
const miny = -5;
const maxy = 100;
int xstep = maxx - minx/79-1;
//int xstep= screen_height/screen_length;
while (i<screen_height)
{
//x = minx;
while(k<screen_length)
{
if (y == x * x)
cout<<'*';
else
if (k == screen_length/2)
cout<<'|';
else
if (i == 24)
cout<<'_';
else
cout<<' ';
x++;
k++;
y++;
}
cout<<endl;
k = 0;
i++;
y--;
}
cin>>a;
}



LinkBack URL
About LinkBacks



