Skip to content

Instantly share code, notes, and snippets.

@jerstlouis
Created May 11, 2014 04:42
Show Gist options
  • Save jerstlouis/0bd285aceb72d6718f80 to your computer and use it in GitHub Desktop.
Save jerstlouis/0bd285aceb72d6718f80 to your computer and use it in GitHub Desktop.
import "ecere"
class TriApp : Application
{
ConsoleFile f { };
void Main()
{
int w = 50;
int h = 20;
bool filled = false;
int x, y;
for(y = 0; y < h; y++)
{
int l = (int)sqrt((w * w + h * h) * (y * y) / (h * h) - (y * y));
if(filled || y == h-1)
{
for(x = 0; x <= l; x++)
f.Putc('*');
}
else
{
f.Putc('*');
if(l > 1)
{
for(x = 1; x <= l-1; x++)
f.Putc(' ');
f.Putc('*');
}
}
f.Putc('\n');
}
system("pause");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment