-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* created fancy/ and added two scripts in it * added chmod +x fancy/* --------- Co-authored-by: sarthak ganure <[email protected]>
- Loading branch information
1 parent
6aa1acc
commit 30e754e
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Define colors | ||
blue='\e[1;34m' | ||
yellow='\e[1;93m' | ||
reset='\e[0m' | ||
|
||
# Function to draw stars | ||
draw_stars() { | ||
for i in {1..30}; do | ||
x=$((RANDOM % $(tput lines))) | ||
y=$((RANDOM % $(tput cols))) | ||
tput cup $x $y | ||
echo -en "${yellow}*" | ||
done | ||
} | ||
|
||
# Function to display starry sky | ||
display_starry_sky() { | ||
clear | ||
draw_stars | ||
sleep 1 | ||
} | ||
|
||
# Main function | ||
main() { | ||
for i in {1..10}; do | ||
display_starry_sky | ||
done | ||
|
||
tput cup $(tput lines) 0 | ||
} | ||
|
||
# Calling the main function | ||
main | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
# Define colors | ||
red='\e[1;31m' | ||
orange='\e[1;33m' | ||
yellow='\e[1;93m' | ||
green='\e[1;32m' | ||
blue='\e[1;34m' | ||
indigo='\e[1;94m' | ||
violet='\e[1;35m' | ||
reset='\e[0m' | ||
|
||
# Rainbow colors array | ||
colors=($red $orange $yellow $green $blue $indigo $violet) | ||
|
||
# Function to draw rainbow line | ||
draw_rainbow_line() { | ||
for color in "${colors[@]}"; do | ||
echo -en "$color#####" | ||
sleep 0.1 | ||
done | ||
echo -e "$reset" | ||
} | ||
|
||
# Function to draw the rainbow | ||
draw_rainbow() { | ||
clear | ||
for i in {1..7}; do | ||
draw_rainbow_line | ||
sleep 0.1 | ||
done | ||
} | ||
|
||
# Main function | ||
main() { | ||
draw_rainbow | ||
echo "Rainbow has been drawn!" | ||
} | ||
|
||
# Calling the main function | ||
main |