JSFiddle - React, Tailwind, and code Playground
JavaScript
var ms = 0;
var currentCrashNumber = 100;
var nextIncrease = 1.25;
var userIncrease = 1.25;
var multiplierInterval = setInterval(function(){
currentCrashNumber=currentCrashNumber + 10/(3.5/(nextIncrease - nextIncrease/1.25))/1000;
console.log(currentCrashNumber);
ms=ms+10;
if(currentCrashNumber >= nextIncrease){
console.log(ms);
nextIncrease = nextIncrease*(userIncrease);
}
if(currentCrashNumber >= 305){
console.log('Script done in ' + ms + 'ms');
clearInterval(multiplierInterval);
}
}, 10);