5 use experimental 'multidimensional';
7 my %seen = ("0,0" => 1);
8 my ($x, $y, $tx, $ty) = (0, 0, 0, 0);
11 my ($dir, $len) = /^(.) (\d+)/;
16 } elsif ($dir eq 'D') {
18 } elsif ($dir eq 'L') {
20 } elsif ($dir eq 'R') {
27 } elsif ($y == $ty + 2) {
33 } elsif ($x == $tx + 2) {
36 } elsif ($x == $tx - 2) {
43 } elsif ($x == $tx + 2) {
50 } elsif ($y == $ty - 2) {
57 } elsif ($y == $ty + 2) {
70 say scalar keys %seen;