diff options
| author | drbaggy <js5@sanger.ac.uk> | 2021-06-24 07:33:07 +0100 |
|---|---|---|
| committer | drbaggy <js5@sanger.ac.uk> | 2021-06-24 07:33:07 +0100 |
| commit | 5e569cc0502be055b953b9cca077fd00bfaefe1c (patch) | |
| tree | 99219a346963f7edc4990889b77169b055ff1085 | |
| parent | 9558c8f816d09218ac3b94764b828b0c077adafb (diff) | |
| download | perlweeklychallenge-club-5e569cc0502be055b953b9cca077fd00bfaefe1c.tar.gz perlweeklychallenge-club-5e569cc0502be055b953b9cca077fd00bfaefe1c.tar.bz2 perlweeklychallenge-club-5e569cc0502be055b953b9cca077fd00bfaefe1c.zip | |
add a dump of the transition matrix
| -rw-r--r-- | challenge-118/james-smith/perl/ch-2.pl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/challenge-118/james-smith/perl/ch-2.pl b/challenge-118/james-smith/perl/ch-2.pl index 5e1d821aae..d7361320e6 100644 --- a/challenge-118/james-smith/perl/ch-2.pl +++ b/challenge-118/james-smith/perl/ch-2.pl @@ -11,6 +11,11 @@ use Data::Dumper qw(Dumper); my @dir = ([-2,1],[2,1],[-2,-1],[2,-1],[-1,2],[1,2],[-1,-2],[1,-2]); my $trans = get_trans(); +say ''; +say '['; +say ' [', join( q(, ), sort { $a<=>$b } @{$_}), '],' foreach @{$trans}; +say ']'; +say ''; my @treasures = qw(a2 b1 b2 b3 c4 e6); my( $sol, $best_len, $best_rt ) = ( 0, 65 ); $sol |= 1 << 8 * (substr $_,1) - 105 + ord $_ foreach @treasures; |
