26 for my $step (split //) {
27 $pos[0]-- if $pos2num{ ($pos[0]-1).",$pos[1]" } && $step eq 'L';
28 $pos[0]++ if $pos2num{ ($pos[0]+1).",$pos[1]" } && $step eq 'R';
29 $pos[1]-- if $pos2num{ "$pos[0],".($pos[1]-1) } && $step eq 'U';
30 $pos[1]++ if $pos2num{ "$pos[0],".($pos[1]+1) } && $step eq 'D';
32 $ret .= $pos2num{$pos[0],$pos[1]};