komentare
[mirrors/Programs.git] / perl / circle.pl
CommitLineData
21c4e167
H
1#!/usr/bin/perl
2use strict;
3use warnings;
4use Math::Trig;
5
6my $r = 20; #radius
7my $zoom = 2; #x zoom
8
9for (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}
This page took 0.303446 seconds and 4 git commands to generate.