A Simple Dice Game
At this stage of development the goal is to generate code that emulates throwing a single six-sided die.
This is the my first attempt to generate a working version of the code presented in the source material. When I am successful then this version will be relegated to an archive page and a new version - one with my own variations and spin on the concepts presented in the source material - will appear here.
I discovered an error in the code from the source material. Several functions are defined to draw pips and these are called by a switch statement but the given function names have mis-matched capitalization in case 1 and case 2.
For my own reasons, I renamed a variable from "ch" (the name in the source material) to "dicevalue"; I felt this was more descriptive and easier to remember. I also added a button to allow repeated dice rolls without having to reload the page.