Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[euler] make solution to problem 22 give correct answer
The input data needed to have the double quotes stripped from it and the
words split on commas.
  • Loading branch information
Paul Cochrane committed Mar 16, 2015
1 parent 328646a commit 3e53705
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion categories/euler/prob022-grondilu.pl
Expand Up @@ -2,8 +2,10 @@
my $i = 1;
constant A = 'A'.ord - 1;
my $names-file = $*PROGRAM_NAME.IO.dirname ~ "/names.txt";
my $data = slurp $names-file;
my @names = sort $data.subst('"', '', :g).split(',');
say [+] gather
for sort slurp $names-file {
for @names {
take $i++ * [+] .comb».ord »-» A;
}

Expand Down

0 comments on commit 3e53705

Please sign in to comment.