Created
December 5, 2016 19:46
-
-
Save zoffixznet/85fb4f181011b34c347f11e367a6afde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $materials = bag flat 'wood' xx 300, 'glass' xx 100, 'brick' xx 3000; | |
my @wanted = | |
house => bag(flat 'wood' xx 200, 'glass' xx 50, 'brick' xx 3000), | |
shed => bag(flat 'wood' xx 300, 'glass' xx 50, 'brick' xx 3000), | |
dog-house => bag( 'wood' xx 50); | |
say 'I can build...'; | |
.say for @wanted».combinations.grep: { $materials ≽ [⊎] |.values }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment