Commit | Line | Data |
---|---|---|
21c4e167 H |
1 | #!/usr/bin/perl |
2 | use strict; | |
3 | use warnings; | |
4 | use Math::Trig; | |
5 | ||
6 | my $r = 20; #radius | |
7 | my $zoom = 2; #x zoom | |
8 | ||
9 | for (my $y=-$r;$y<=$r;$y++) { | |
10 | my @line = split(//," "x(2*$zoom*$r)); | |
11 | my $x = int(sqrt(($r*$r)-($y*$y))+.5); | |
12 | $line[($r-$x)*$zoom] = "+"; | |
13 | $line[($r+$x)*$zoom] = "+"; | |
14 | print @line; print "\n"; | |
15 | } |