Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
GLR tweaks to advent 2010 days 08 & 11
  • Loading branch information
dwarring committed Aug 22, 2015
1 parent 7c1bd67 commit 08eeb00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions integration/advent2010-day08.t
Expand Up @@ -10,11 +10,10 @@ is do {flip "hello"}, "olleh", 'string reversal';
is do {join ", ", reverse <ab cd ef>}, "ef, cd, ab", 'list reversal';

my %capitals = France => "Paris", UK => "London";
is-deeply %capitals.invert.sort, $("London" => "UK", "Paris" => "France"), 'hash inversion';
is-deeply [%capitals.invert.sort], ["London" => "UK", "Paris" => "France"], 'hash inversion';

my %original := %capitals;
my %inverse;
%inverse.push( %original.invert );
my %inverse = %original.invert;

is-deeply %inverse, {"Paris" => "France", "London" => "UK"}, 'hash inversion, non-distructive';

Expand Down
4 changes: 2 additions & 2 deletions integration/advent2010-day11.t
Expand Up @@ -42,5 +42,5 @@ for sliding-window($model-text.comb, 3) -> $a, $b, $c {
my $first = $model-text.substr(0, 1);
my $second = $model-text.substr(1, 1);
my @chain := $first, $second, -> $a, $b { my $r = %next-step{$a ~ $b}.roll.key } ... *;
my @result = @chain.munch(80);
ok @result > 2, 'got result';
my @result = @chain[0..79];
ok @result > 2, 'got result';

0 comments on commit 08eeb00

Please sign in to comment.