Sha256: ddebeaa6a5780e3deedbd75471cfd05f92ae707fa1cd0ff8ec5ee0bbec6025c8

Contents?: true

Size: 125 Bytes

Versions: 365

Compression:

Stored size: 125 Bytes

Contents

sub to-decimal($num) is export {

    return 0 if $num ~~ /<-[012]>/;

    return reduce { 3 * $^a + $^b }, 0, |$num.comb;
}

Version data entries

365 entries across 365 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.179 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.178 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.177 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.176 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.175 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.174 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.173 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.172 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.171 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.170 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.169 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.167 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.166 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.165 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.164 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.163 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.162 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.161 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6
trackler-2.2.1.160 tracks/perl6/exercises/trinary/.meta/solutions/Trinary.pm6