aboutsummaryrefslogtreecommitdiff
path: root/challenge-059/simon-proctor
diff options
context:
space:
mode:
authorSimon Proctor <simon.proctor@zoopla.co.uk>2020-05-04 10:40:54 +0100
committerSimon Proctor <simon.proctor@zoopla.co.uk>2020-05-04 10:40:54 +0100
commitc4d4ea6d47d2bdb737cec5ad05472f63e7e762d3 (patch)
treec43616922d8a8542af5d4e91e6fd38142fa76047 /challenge-059/simon-proctor
parent926addea943c4d8b64fa8c5476a931d55379593c (diff)
downloadperlweeklychallenge-club-c4d4ea6d47d2bdb737cec5ad05472f63e7e762d3.tar.gz
perlweeklychallenge-club-c4d4ea6d47d2bdb737cec5ad05472f63e7e762d3.tar.bz2
perlweeklychallenge-club-c4d4ea6d47d2bdb737cec5ad05472f63e7e762d3.zip
doesn't use a likned list directly because it's a weird thing to do in Perl or Raku
Diffstat (limited to 'challenge-059/simon-proctor')
-rw-r--r--challenge-059/simon-proctor/raku/ch-1.raku13
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-059/simon-proctor/raku/ch-1.raku b/challenge-059/simon-proctor/raku/ch-1.raku
new file mode 100644
index 0000000000..3c485e913a
--- /dev/null
+++ b/challenge-059/simon-proctor/raku/ch-1.raku
@@ -0,0 +1,13 @@
+#!/usr/bin/env raku
+
+use v6;
+
+#| Given an inflaction point and a list of values put all the items less than the inflection point
+#| at the start of the last and all those great or equal after. Retain ordering.
+sub MAIN (
+ Int $inflection, #= Inflection point
+ *@rest where .all ~~ Int #= List of values
+) {
+ my %c = @rest.classify( * >= $inflection );
+ ( |%c{False}, |%c{True} ).say;
+}