Bitmap/Midpoint circle algorithm: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→{{header|C sharp}}: Regularize header markup to recommended on category page) |
(added Perl programming solution) |
||
Line 1,700: | Line 1,700: | ||
................ |
................ |
||
................</pre> |
................</pre> |
||
=={{header|Perl}}== |
|||
<lang perl># 20220301 Perl programming solution |
|||
use strict; |
|||
use warnings; |
|||
use Algorithm::Line::Bresenham 'circle'; |
|||
my @points; |
|||
my @circle = circle((10) x 3); |
|||
for (@circle) { $points[$_->[0]][$_->[1]] = '#' } |
|||
print join "\n", map { join '', map { $_ || ' ' } @$_ } @points</lang> |
|||
{{out}} |
|||
<pre> |
|||
####### |
|||
## ## |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
# # |
|||
## ## |
|||
####### |
|||
</pre> |
|||
=={{header|Phix}}== |
=={{header|Phix}}== |