dot

packages and services management
Log | Files | Refs | README

commit 2c7c83bb54ab4232fdd92ee318f404dcb7f00105
parent da2194ecb74b6f0836d19ad4b25973fe197a8de1
Author: Josuah Demangeon <mail@josuah.net>
Date:   Thu, 20 Apr 2017 11:42:00 +0200

added io-troll

Diffstat:
Abin/io-troll | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+), 0 deletions(-)

diff --git a/bin/io-troll b/bin/io-troll @@ -0,0 +1,78 @@ +# troll + + +troll() +{ + printf '\033[%d;%dH' "$2" "$1" + + printf '\033[10C\v%s' ',--------.' + printf '\033[11D\v%s' '/ ,===-=== `.' + printf '\033[14D\v%s' '//__(*= (*-.\\' + printf '\033[16D\v%s' '(((,__` ,c-).~~))' + printf '\033[16D\v%s' '\ \ `------'\''||' + printf '\033[14D\v%s' '\ `-.______, |' + printf '\033[18D\v%s' ' `-._ ------ |' + printf '\033[9D\v%s' '`-.____/' +} + + +roll() +{ + size="$(stty size)" + + hexdump -d /dev/random | + sed 's/[^ ]* *//; s/[0 ]\+/\n/g' | sed '/^$/ d' | + while read num + do + if [ -z "$row" ] + then + [ "$num" -lt "${size#* }" ] && row="$num" + + elif [ -z "$col" ] + then + [ "$num" -lt "${size% *}" ] && col="$num" + else + troll "$row" "$col" + row='' col='' + fi + done +} + + +main() +{ + iomenu -l 30 -p troll << EOF | grep troll && roll + holl ooll coll + troll + ,--------. troll + ^oll voll ^oll voll oll loll vroll + / ,===-=== \`. troll + /oll //^\\\\ \\oll + ///^\\\\\\\\\\ \\oll trall + ////^\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\oll trod + /////^\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + //////^\\\\\\\\\\\\\\\\\\\\loll\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ holl + //__(*= (*-.\\\\ troll troll + )))tr______(___)_________trill____________________oll + (((========)===(===================================== + ))) ( (( moll doll zoll coll ooll roll coll + (((,__\` ,c-).~~)) troll + / / / /trovovo / / \\ \\ \\ floll woll + \\ \\ \\ \\ \\ | \\ \\ / / / toll + / / / / trololo/ / \\ \\ \\ yoll roll + \\ \\ \`------'|| troll + trololo | | | | | doll woll poll + \\ \`-.______, | troll + moll ~~~trololo~ l ~~~ moll ioll + \`/ \`/_ \`\\tralala \`/ \`/{}_ _\\ _\\ + \`-._ ------ | troll + rolls _\\_\\_\\trilili\\ /_/_/_/_/_/_/ ~~~~~~~~~~~~\`\` + troll \`-.____/ + _.-' \\ \\-\\ oll trololo +/ \\ ~ -- / \\\\ roll troo moll trololo + troll +EOF +} + + +main "$@"