Xiaolin Wu's line algorithm: Difference between revisions
Content added Content deleted
(+ C# implemented code) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: parentheses needed around x/y in main loop) |
||
Line 1,278: | Line 1,278: | ||
=={{header|Perl 6}}== |
=={{header|Perl 6}}== |
||
{{works with|niecza|2013-03-02}} |
|||
<lang perl6>sub plot(\x, \y, \c) { say "plot {x} {y} {c}" } |
<lang perl6>sub plot(\x, \y, \c) { say "plot {x} {y} {c}" } |
||
Line 1,328: | Line 1,327: | ||
Z |
Z |
||
(intery, intery + gradient ... *) |
(intery, intery + gradient ... *) |
||
-> \x,\y { |
-> (\x,\y) { |
||
my \c = fpart(y); |
my \c = fpart(y); |
||
$plot(x, floor(y) , 1 - c) unless c == 1; |
$plot(x, floor(y) , 1 - c) unless c == 1; |