add box around board

This commit is contained in:
adam committed 2025-01-21 19:40:30 +00:00
1 parent f43f5216f5
commit f1c214ddd4
1 file changed
+6 -3
+6 -3
View File
@@ -24,8 +24,8 @@ function reveal_row() {
echo -en "${SAVE}"
echo -en "${HIDE_CURSOR}"
# Must increment by 1 Row as 0 == 1 for escape code
declare RNUM=$(( $1+1 ))
echo -en "\e[$RNUM;0H"
declare RNUM=$(( $1+2 ))
echo -en "\e[$RNUM;2H"
for (( C=0; C<WIDTH; C++ )); do
echo -n "${BOARD[$1,$C]}"
read -r -s -t 0.5
@@ -109,13 +109,16 @@ function render_board() {
declare row
declare char
echo '┌───────────────┐'
for (( row=0; row<HEIGHT; row++ )); do
echo -n '│'
for (( char=0; char<WIDTH; char++ )); do
echo -n "${BOARD[${row},${char}]}${RESET}"
done
echo -n '│'
echo -en "${DOWN1}"
done
echo '└───────────────┘'
}
function init_board() {