From 60550fc47cf8143fd473ba990691bc83d52a8f03 Mon Sep 17 00:00:00 2001 From: gashapwn Date: Sun, 4 Apr 2021 02:06:10 +0000 Subject: [PATCH] lpst.pl - we can move a little dude around the board now!! --- lpst.pl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lpst.pl b/lpst.pl index c0b257a..ebd78eb 100644 --- a/lpst.pl +++ b/lpst.pl @@ -238,7 +238,12 @@ sub disp_2($$){ my ($r0, $c0) = (shift, shift); my $p; - $p = $board{$r0}{$c0}; + # Cell notation + my $not; + + $not = cell_index_rev($c0, $r0); + + $p = $board{$not}; return f_1($p); # my ($r0, $c0) = (shift, shift); @@ -376,6 +381,10 @@ sub disp_board(){ printf("%s", $b); } +sub cell_index_rev($$){ + return $AXIS_RV{$_[0]}.$_[1]; +} + sub cell_index($){ my ($chr1, $chr2) = (split(//, $_[0])); return ($AXIS{$chr1}, $chr2); @@ -393,11 +402,10 @@ sub cell_index($){ $AXIS_RV{$_} }(1...11); -$board{"C3"} = $P1.$DIV.$MG_A; +$board{"D2"} = $P1.$DIV.$MG_A; -printf("%s\n", $board{"C3"}); -# disp_board(); +disp_board(); # disp_0("C1"); # printf(">>%s, %s\n", cell_index("C1"));