Hi,
As the title states I must write a PERL program that randomly generates a number between 1 and 50 in groups of 5. Sum each group and display the results so that each number is on its own line. This question was given to be in the first week of a introduction to Perl class that I am taking and I have to admit I am a little lost. I figured out how to do the first part "randomly generates a number between 1 and 50 in groups of 5" but for the live of me I can not figure out the rest. Any help would be much appreciated. Where is what I have so far.
#!/usr/bin/env perl use strict; use warnings; use List::Util 'shuffle'; use List::MoreUtils qw(natatime); use feature qw(say); my $iterator = natatime 5, shuffle( 1 .. 50 ); my $count = 1; while ( my @five = $iterator->() ) { say join " ", @five; $count++; last if $count > 5; }
2017-11-14 Athanasius retitled and added code and paragragh tags
In reply to Dice roll chances by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |