Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement