Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ######################################################################
- #Copyright (C) 2024 Kris Occhipinti
- #https://filmsbykris.com
- #This program is free software: you can redistribute it and/or modify
- #it under the terms of the GNU General Public License as published by
- #the Free Software Foundation version 3 of the License.
- #This program is distributed in the hope that it will be useful,
- #but WITHOUT ANY WARRANTY; without even the implied warranty of
- #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- #GNU General Public License for more details.
- #You should have received a copy of the GNU General Public License
- #along with this program. If not, see <http://www.gnu.org/licenses/>.
- ######################################################################
- clear
- function draw_grid() {
- start_x=$1
- width=$(($start_x + $2))
- start_y=$3
- height=$(($start_y + $4))
- # hide cursor
- printf "\033[?25l"
- for x in $(seq $start_x 2 $width); do
- for y in $(seq $start_y $height); do
- printf "\033[${y};${x}H█"
- sleep .001
- done
- done
- for x in $(seq $start_x $width); do
- for y in $(seq $start_y 2 $height); do
- printf "\033[${y};${x}H█"
- sleep .001
- done
- done
- # show cursor
- printf "\n\033[?25h"
- }
- draw_grid 4 40 10 15
- printf "\033[34m" # blue
- draw_grid 72 40 10 6
- printf "\033[31m" # red
- draw_grid 40 40 2 14
- printf "\033[0m" # reset color
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement