Skip to content

Instantly share code, notes, and snippets.

@m0rb
Created July 19, 2018 16:37
Show Gist options
  • Save m0rb/4a4e02b8f7996d9422db4e382de80b2c to your computer and use it in GitHub Desktop.
Save m0rb/4a4e02b8f7996d9422db4e382de80b2c to your computer and use it in GitHub Desktop.
bingo.sh
#!/bin/bash
[ -z $1 ] && echo "Usage: $0 listfile.txt" && exit 1
IFS=$'\r\n'
LIST=($(cat $1))
RNG=($(shuf -i 0-$(( ${#LIST[@]} - 1)) -n 25))
I=0
for X in {1..25};
do convert -background white -size 120x120 -gravity Center -weight 500 -pointsize 14 caption:"${LIST[${RNG[${I}]}]}" cell${X}.png
I=$(( $I + 1 ))
done
montage -frame 3 cell*png bingo.png
rm cell*png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment