JS version of dice game