The Bruke's Lair

A personal website for gaming and coding.


A Simple Dice Game

Overview

At this stage of development the goal is to generate code that emulates throwing two six-sided dice.

Play Dice!

Your browser doesn't support the HTML5 canvas element.

Design Notes

Version 0.2.0
11/11/2015

While the first version emulated rolling one die, this version will emulate rolling two dice at the same time.

I spent some time reading about the javascript Math.random() function. It's not really random (is anything?) but it uses the current time (in microseconds) as part of the calculation. I guess if you can time your button presses to the microsecond, learn your browser's algorithms, and account for processor latency then you can cheat. Still, it looks random enough for now. Interesting reading at https://en.wikipedia.org/wiki/Sierpinski_triangle