mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-18 14:30:40 +01:00
Battleship: Draw border on right and bottom too
This commit is contained in:
parent
9f54843e40
commit
1231c7b682
@ -977,9 +977,27 @@ sub show_battlefield {
|
|||||||
$buf .= "$self->{board}->[$y][$x] ";
|
$buf .= "$self->{board}->[$y][$x] ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$buf .= sprintf("$color{cyan}%c", 97 + $y);
|
||||||
$buf .= "$color{reset}\n";
|
$buf .= "$color{reset}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# bottom border
|
||||||
|
$buf .= "$color{cyan} ";
|
||||||
|
|
||||||
|
for($x = 1; $x < $self->{N_X} + 1; $x++) {
|
||||||
|
if ($x % 10 == 0) {
|
||||||
|
$buf .= $color{yellow} if $self->{N_X} > 10;
|
||||||
|
$buf .= $x % 10;
|
||||||
|
$buf .= ' ';
|
||||||
|
$buf .= $color{cyan} if $self->{N_X} > 10;
|
||||||
|
} else {
|
||||||
|
$buf .= $x % 10;
|
||||||
|
$buf .= ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$buf .= "\n";
|
||||||
|
|
||||||
my $player1 = $self->{player}->[0]->{nick};
|
my $player1 = $self->{player}->[0]->{nick};
|
||||||
my $player2 = $self->{player}->[1]->{nick};
|
my $player2 = $self->{player}->[1]->{nick};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user