Railway circuit: Difference between revisions
m
→{{header|Raku}}: Use True instead of '1', remove single-use variable
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: use False/True instead of 0/1) |
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: Use True instead of '1', remove single-use variable) |
||
Line 1,313:
sub digits($n!, $base!, $pad=0) {
my @output = $n.base($base).comb.reverse;
return @output
} # rough port of https://docs.julialang.org/en/v1/base/numbers/#Base.digits
Line 1,320:
sub circularsymmetries(@c) { (0..^+@c).map: {rotate @c, $_} }
my @allsym = |(circularsymmetries turns), |(circularsymmetries -«turns);
%infound{$_.Str} =
return @allsym.max
}
|