Sha256: 8000d67486fdf8d72961d0cec0efbfb22e7a540655e90e9297e5565df3f16e02
Contents?: true
Size: 629 Bytes
Versions: 82
Compression:
Stored size: 629 Bytes
Contents
exercise: Grains version: 1 plan: 13 imports: '&grains-on-square &total-grains' tests: | for @($c-data<cases>[0]<cases>) { if .<expected> == -1 { throws-like { grains-on-square(.<input>) }, Exception, .<description>; } else { is grains-on-square(.<input>), |.<expected description>; } } is total-grains, |$c-data<cases>[1]<expected description>; unit: module example: | 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
82 entries across 82 versions & 1 rubygems