I took the day off to look for a new laptop. So I devised this clever little script to manage my time today.
#! /bin/bash
# Flip a coin to see if I should have another beer.
# experimentaly biased. :-)
HEAD=0
TAIL=0
for x in 1 2 3 4 5 6 7 8 9
do
FLIP=$(($(($RANDOM%10))%2))
if [ $FLIP -eq 1 ]
then
echo "TAIL"
TAIL=$(($TAIL+1))
else
echo "HEAD"
HEAD=$(($HEAD+1))
fi
done
if [ $HEAD -gt $TAIL ]
then
echo "BEER TIME.!"
else
echo "Your not entitled to a beer. Run $0 again."
fi
I am still looking for a new laptop.
Subscribe to:
Post Comments (Atom)
1 comment:
brilliant!
Post a Comment