Browse Source

lpst.pl - we can move a little dude around the board now!!

master
gashapwn 3 years ago
parent
commit
60550fc47c
1 changed files with 12 additions and 4 deletions
  1. +12
    -4
      lpst.pl

+ 12
- 4
lpst.pl View File

@@ -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"));

Loading…
Cancel
Save