Marching squares: Difference between revisions
m
→{{header|Raku}}: small simplifications
m (→{{header|Raku}}: insignificant changes) |
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: small simplifications) |
||
Line 338:
for ^width X ^height -> (\x,\y) {
my ($cx,$cy,$directions,$previous) = x, y;
repeat {
my $mask
for (0,0,1),(1,0,2),(0,1,4),(1,1,8) -> (\dx,\dy,\b) {
my ($mx,$my) = $cx+dx,$cy+dy;
$mask += b if
}
given do given $mask {
Line 355:
} {
$directions ~= $previous = $_ ;
($cx,$cy) <<+=<<
}
} until $cx==x and $cy==y ;
|