#!/usr/bin/env perl
use 5.020;
use utf8;
use Term::ANSIColor qw(color);
my $game = [
[qw(♔ ♕ ♖ ♗ ♘ ♙)],
[(' ') x 6],
[(' ') x 6],
[(' ') x 6],
[(' ') x 6],
[qw(♚ ♛ ♜ ♝ ♞ ♟)],
];
my $blue_circle = color('blue') . '●' . color('reset');
my $game_height = scalar $game->@*; # 6
my $game_width = scalar $game->[0]->@*; # 6
my $board_height = $game_height * 2; # 12
my $board_width = $game_width * 4; # 24
my $board;
for my $y (0 .. $board_height) {
$board->[$y] = $y % 2
? [
'|', map {
(' ', $_, ' ', '|')
} $game->[($y - 1) / 2]->@*
]
: ['+', qw(- - - +) x $game_width]
}
for my $y (0, $board_height) {
for my $x (0, $board_width / 2, $board_width) {
$board->[$y][$x] = $blue_circle;
}
}
for my $x (0, $board_width) {
$board->[$board_height / 2][$x] = $blue_circle;
}
for my $row ($board->@*) {
say join '', $row->@*;
}