User prompt
Persist Times Rolled counter through resets.
User prompt
Please fix the bug: 'Uncaught TypeError: setInterval is not a function' in or related to this line: 'timeSinceLastResetInterval = setInterval(function () {' Line Number: 380
User prompt
make time since last reset count up until reset button is pressed.
User prompt
Increase time since last reset after every reset.
User prompt
Change 'Hat = 60' text to Hat = 60: 0. Add 1 to Hat = 60: 0 every time dice side is 6. Increase this counter separately of other prize counters.
User prompt
Change 'Claw = 50' text to Claw = 50: 0. Add 1 to Claw = 50: 0 every time dice side is 5. Increase this counter separately of other prize counters.
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'getItem')' in or related to this line: 'timesRolled = parseInt(localStorage.getItem('timesRolled')) || 0;' Line Number: 265
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'getItem')' in or related to this line: 'timesRolled = parseInt(localStorage.getItem('timesRolled')) || 0;' Line Number: 253
User prompt
Change 'Snake = 40' text to Snake = 40: 0. Add 1 to Snake = 40: 0 every time dice side is 4. Increase this counter separately of other prize counters.
User prompt
Increase prize counters separately
User prompt
Change 'Choc = 30' text to Choc = 30: 0. Add 1 to Choc = 30: 0 every time dice side is 3
User prompt
Make Prizes Won table text permanently displayed
User prompt
Change 'Rose = 20' text to Rose = 20: 2. Add 1 to Rose = 20: 0 every time dice side is 2
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'split')' in or related to this line: 'var bearPrizeText = prizesWonTxt.text.split('\n');' Line Number: 199
User prompt
Add 1 to Bear = 10: 0 every time dice side is 1
User prompt
Add 1 to Bear = 10 every time dice side is 1
User prompt
Change 'Bear = 10' text to Bear = 10: 0
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'getItem')' in or related to this line: 'timesRolled = parseInt(localStorage.getItem('timesRolled')) || 0;' Line Number: 219
User prompt
Delete bear won text pop-up
User prompt
Change Prizes won text to Red
User prompt
List prizes won text vertically
User prompt
Decrease size of prizes won text and make it fit the screen
User prompt
Add Prizes Won: Bear = 10, Rose = 20, Choc = 30, Snake = 40, Claw = 50, Hat = 60' text underneath time since last reset.
User prompt
Make 'Bear Won' text disappear after 2 seconds.
===================================================================
--- original.js
+++ change.js
@@ -180,8 +180,11 @@
currentCashTxt.setText('Current Cash: ' + currentCash);
totalCashTxt.setText('Total Cash: ' + totalCashWon);
timesRolled++;
timesRolledTxt.setText('Times Rolled: ' + timesRolled);
+ if (typeof localStorage !== 'undefined') {
+ localStorage.setItem('timesRolled', timesRolled);
+ }
// Reset time since last roll
timeSinceLastRoll = 0;
// Increase Bear prize count if dice side is 1
if (dice.value === 1) {
@@ -267,10 +270,12 @@
currentCashTxt.setText('Current Cash: ' + currentCash);
totalTimeTxt.setText('Total Time: ' + totalTime + 's');
currentTime = 0;
currentTimeTxt.setText('Current Time: ' + currentTime + 's');
- timesRolled = typeof localStorage !== 'undefined' && localStorage.getItem('timesRolled') !== null ? parseInt(localStorage.getItem('timesRolled')) : 0;
timesRolledTxt.setText('Times Rolled: ' + timesRolled);
+ if (typeof localStorage !== 'undefined') {
+ localStorage.setItem('timesRolled', timesRolled);
+ }
timesReset++;
timesResetTxt.setText('Times Reset: ' + timesReset);
if (typeof localStorage !== 'undefined') {
localStorage.setItem('timesReset', timesReset);
@@ -345,8 +350,11 @@
// Global variable to keep track of current cash
var currentCash = 0;
// Global variable to keep track of times rolled
var timesRolled = 0;
+if (typeof localStorage !== 'undefined' && localStorage.getItem('timesRolled') !== null) {
+ timesRolled = parseInt(localStorage.getItem('timesRolled')) || 0;
+}
if (typeof localStorage !== 'undefined') {
if (typeof localStorage !== 'undefined' && localStorage.getItem('timesRolled') !== null) {
timesRolled = parseInt(localStorage.getItem('timesRolled')) || 0;
}