Created
December 5, 2016 20:20
-
-
Save zoffixznet/6b73e7f0e039db3d00facadc1f5c1db4 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 = | |
bag(flat 'wood' xx 200, 'glass' xx 50, 'brick' xx 3000) but "house", | |
bag(flat 'wood' xx 100, 'glass' xx 50) but "shed", | |
bag( 'wood' xx 50) but "dog-house"; | |
say 'I can build...'; | |
.put for @wanted.combinations.grep: { $materials ≽ [⊎] |$^stuff-we-want }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment