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


Tags: , , ,
Copyright 2017. All rights reserved.

Posted March 12, 2013 by Tux Think in category "Linux