Railway circuit: Difference between revisions

m
→‎{{header|Raku}}: Use True instead of '1', remove single-use variable
m (→‎{{header|Perl}}: use False/True instead of 0/1)
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;
if ($pad > my $size = +@output) { @output.append: 0 xx ($pad - $size+@output) }if $pad > +@output;
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} = 1True for @allsym;
return @allsym.max
}
2,392

edits