Skip to content

Instantly share code, notes, and snippets.

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/52728fa072f7ceca1fd5aeba7c6e96e5 to your computer and use it in GitHub Desktop.
Save zoffixznet/52728fa072f7ceca1fd5aeba7c6e96e5 to your computer and use it in GitHub Desktop.
S32-list/categorize.t: my %got = categorize &mapper, <A♣ 10♣ 6♥ 3♦ A♠ 3♣ K♠ J♥ 6♦ Q♠ K♥ 8♦ 5♠>;
S32-list/categorize.t: '6' => ['6♥', '6♦'],
S32-list/categorize.t: '♥' => ['6♥', 'J♥', 'K♥'],
S32-list/categorize.t: 'K' => ['K♠', 'K♥'],
S32-list/categorize.t: 'J' => ['J♥'],
integration/advent2013-day18.t: token suit:sym<♥> {<sym>}
integration/advent2013-day18.t: is ~CardGame.parse("2♥ 5♥ 7♦ 8♣ 9♠"), "2♥ 5♥ 7♦ 8♣ 9♠", "card game parse";
integration/advent2013-day18.t: is ~CardGame.parse("2♥ a♥ 7♦ 8♣ j♥"), "2♥ a♥ 7♦ 8♣ j♥", "card game parse";
integration/advent2013-day18.t: is ~CardGame.parse("2♥ a♥ 7♦ 8♣ j♥", :actions($a)), "2♥ a♥ 7♦ 8♣ j♥", "card game + actions parse";
integration/advent2013-day18.t: is ~CardGame.parse("a♥ a♥ 7♦ 8♣ j♥", :actions($a)), "a♥ a♥ 7♦ 8♣ j♥", "card game + actions parse";
integration/advent2013-day18.t: is ~CardGame.parse("a♥ 7♥ 7♦ 8♣ j♥; 10♥ j♥ q♥ k♥ a♦",
integration/advent2013-day18.t: :actions($a)), "a♥ 7♥ 7♦ 8♣ j♥; 10♥ j♥ q♥ k♥ a♦", "card game + actions parse";
integration/advent2013-day18.t: is-deeply $a.dups, ["a♥", "j♥"], 'duplicates detected in actions';
integration/advent2013-day18.t: token suit:sym<♥> {<sym>}
integration/advent2013-day18.t: is ~CardGame.parse("2♥ 7♥ 2♦ 3♣ 3♦"), "2♥ 7♥ 2♦ 3♣ 3♦", 'card game parse';
integration/advent2013-day18.t: ok !defined(CardGame.parse("a♥ a♥ 7♦ 8♣ j♥")), 'duplicate detection - parse failure';
integration/advent2013-day18.t: ok !defined(CardGame.parse("a♥ 7♥ 7♦ 8♣ j♥; 10♥ j♥ q♥ k♥ a♦")), 'duplicate detection - parse failure';
integration/advent2013-day18.t: is-deeply @dups, ["a♥", "j♥"], 'duplicates detected in grammar';
integration/advent2009-day15.t: for <♥ ♣ ♦ ♠> -> $suit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment