Man………………… I’ve got a LOT to learn. 
So I started out with a filter function, just to arrange the dice rolls from greatest to largest, then started an if statement were if any equal 1, then thats the score, and put it into the innerhtml. If only it were that easy right.
I dont think a single line of code was right there
. I didn’t put the filter function outside of it, so it wasnt even called upon, and basically nothing was right.
So I decided to start with basics, if I click this button will it show a number. It does, So then if this die value is 1, add 1 to the tally, and then display the tally score. That doesnt work.
It was because the die’s value is locked in a function, so it needs to exist in the main script. easy fix, and now it works
. But the code is very simple, it’ll work for 1s-6s, which is nice, but I want a deeper code understanding. I’ll have to use an array, and index it for short/long straight. I’ll have to make sure you can only click it once, verify if your score will be 0, and reset dice rolls to make sure you can roll again. But thats a problem for another day. So adios
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.