Update js/dice.js

Converted dicecup on a function