Created
May 30, 2014 01:10
-
-
Save liz-baker/c376431b1235dafdb67b to your computer and use it in GitHub Desktop.
Handles dice in the form of NdS, where N is number and S is die size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
let num=${1%d*} | |
let die=${1#*d} | |
let result="$num*($[$RANDOM % $die]+1)" | |
print $result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment