Advertisement
metalx1000

BASH Dice Roller with Sound

Dec 13th, 2017
817
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. #!/bin/bash      
  2. #title           :Dice Roller
  3. #description     :Rolls Dice
  4. #author          :Kris Occhipinti - https://filmsbykris.com
  5. #date            :2017-12-13
  6. #version         :0.1
  7. #notes           :sox is needed for tones (sudo apt install sox)
  8. #==============================================================================
  9.  
  10. dice=(⚀ ⚁ ⚂ ⚃ ⚄ ⚅)
  11. for i in {1..10}
  12. do
  13.   d=${dice[$RANDOM % ${#dice[@]} ]}
  14.   echo -en "\r$d"
  15.   sleep .1
  16.   play -n -c1 synth fade h 0.1 .1 0.1 2>/dev/null
  17. done
  18.  
  19. echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement