From 72461058ed14697b4c5e1ca6bc559b85021f00ac Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 15 Mar 2024 15:17:14 +0000 Subject: [PATCH] Generate border lines separately --- griddle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/griddle b/griddle index df87fe9..93e248b 100755 --- a/griddle +++ b/griddle @@ -20,12 +20,22 @@ generate_lines() { width="$3" height="$4" + # Generate border lines + border_width=$((width - 1)) + border_height=$((height - 1)) + printf "line 0, 0 0, %d " $border_height + printf "line 0, 0 %d, 0 " $border_width + printf "line 0, %d %d, %d " $border_height $border_width $border_height + printf "line %d, 0 %d, %d " $border_width $border_width $border_height + + # Generate column separators colwidth=$((width / columns)) for i in $(seq 0 $columns); do current_colwidth=$((colwidth * i)) printf "line %d, 0 %d, %d " $current_colwidth $current_colwidth $height done + # Generate row separators rowheight=$((height / rows)) for i in $(seq 0 $rows); do current_rowheight=$((rowheight * i))