Sha256: 59db3aa10750bccb1c35a7eb35caf39359ba65a883f54e5eacae3c09e26a60b7

Contents?: true

Size: 236 Bytes

Versions: 185

Compression:

Stored size: 236 Bytes

Contents

unit module Grains:ver<1>;

sub grains-on-square ($number) is export {
  die if $number < 1 or $number > 64;
  2**($number-1);
}

sub total-grains is export {
  my Int $total;
  for  1..64 { $total += grains-on-square($_) }
  $total;
}

Version data entries

185 entries across 185 versions & 1 rubygems

Version Path
trackler-2.2.1.75 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.74 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.73 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.72 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.71 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.70 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.69 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.68 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.67 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.66 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.65 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.64 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.63 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.62 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.61 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.60 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.59 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.58 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.57 tracks/perl6/exercises/grains/Example.pm6
trackler-2.2.1.56 tracks/perl6/exercises/grains/Example.pm6