Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created December 5, 2016 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/0601b566a589d9921cffc3eee33f0dca to your computer and use it in GitHub Desktop.
Save zoffixznet/0601b566a589d9921cffc3eee33f0dca to your computer and use it in GitHub Desktop.
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