virtual dice on the linux terminal

Here is a script that will act like a dice, a six sided dice, on the terminal.
On running the script, it will display numbers between 1 and 6 randomly, random number of times and at the end settle to one number just as in a usual dice.

dice.sh :

#!/bin/bash roll_dice() { max_dice=$((max_dice-1)) roll=$RANDOM roll=$((roll % max_roll)) roll=$((roll + 1)) n_cols=$(tput cols) col=$((n_cols/2)) for((i=0;i

Category: Linux | Comments Off on virtual dice on the linux terminal

Linux script to create colorful 2013 on the terminal

Here is a script with which you can create the number 2013, on your terminal using any character of your choice. The colors of the numbers will change randomly on every run of hte script.

2013.sh:

#!/bin/bash str_dwn() { rows=$1 s_start=$2 char=$4 str_st_row=$3 rows_end=$((str_st_row+rows)) for((i=str_st_row;i

Category: Linux | Comments Off on Linux script to create colorful 2013 on the terminal

colorful Christmas Tree on linux terminal

Here is a version 2 of the Christmas tree creation script. The script will create a colorful Christmas tree on the terminal. The colors of the tree will change on every run.

The script will take as input the character with which the tree has to be drawn, and any two characters that have to be used to decorated the tree.

Christmas_tree:

#!/bin/bash backslash() { b_st_row=$1 b_st_cols=$2 b_char=$3 deco=$5 b_r_end=$((b_st_row + 5 )) for((p=b_st_row;p

Category: Linux | Comments Off on colorful Christmas Tree on linux terminal