Hi, I'm new to the whole programming environment. I'm currently taking an object oriented programming class and am a bit lost on my first assignment.
I know there is already thread for how to draw a diamond but it doesn't answer my question. I'm trying to draw a diamond with border characters and fill characters. The code I have so far draws the border characters but I'm not sure where to begin for the fill characters. I have tried a few different things but all them seem to do is make a square of fill characters. I'm not sure if I'm making any sense but any advice would be much appreciated. Thanks.
Sheri
void Diamond:: Draw()
{
int h, g, i;
for(h = 0; h < side; h++)
{
for(g = 0; g < side; g++)
{
if(h < side/2)
{
if(g == side/2 - h || g == side/2 + h)
{
cout << border;
}
else
{
cout << " ";
}
}
else
{
if(g == h - side/2 || g == side - (h - side/2) - 1)
{
cout << border;
}
else
{
cout << " ";
}
}
}
cout << '\n';
}
}