diff options
| -rw-r--r-- | challenge-071/simon-proctor/raku/ch-1.raku | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-071/simon-proctor/raku/ch-1.raku b/challenge-071/simon-proctor/raku/ch-1.raku new file mode 100644 index 0000000000..af23f3ea3b --- /dev/null +++ b/challenge-071/simon-proctor/raku/ch-1.raku @@ -0,0 +1,14 @@ +#!/usr/bin/env raku + +use v6; + +# Generate a list of random numbers then find the picks +sub MAIN( + UInt $N where 1 < * <= 50 #= Size of random number list +) { + my @list = (1..50).pick($N); + my @peaks = ( 0, |@list, |0 ).rotor(3 => -2).grep( { $_[0] < $_[1] > $_[2] } ).map( { $_[1] } ); + say "List : {@list.join(',')}"; + say "Peaks : {@peaks.join(',')}"; + +} |
