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))