Pentagram: Difference between revisions
m
→{{header|Perl 6}}: Modernize
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Modernize) |
|||
Line 513:
=={{header|Perl 6}}==
{{works with|rakudo|
Generate an SVG file to STDOUT. Redirect to a file to capture and display it.
<lang perl6>
constant $sides = 5;▼
constant $dim = 200;
▲constant $sides = 5;
<rect height="100%" width="100%" style="fill:bisque;" />▼
STOP▼
my @vertices = map { 0.9 * $dim * cis($_ * τ / $sides) }, ^$sides;
flat @vertices[0, 2 ... *], @vertices[1, 3 ... *], @vertices[0];
say SVG.serialize(
svg => [
:width($dim*2), :height($dim*2),
style="fill:seashell; stroke:blue; stroke-width:3;"▼
:polyline[ :points(@points.join: ','),
transform="translate($dim, $dim) rotate(-18)" />▼
}</lang>▼
],
See [https://gist.github.com/thundergnat/70108a5160dd17dfe374#file-pentagram-svg Pentagram]▼
▲See [https://
=={{header|Phix}}==
|