Last active
October 29, 2023 13:31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const p = 0.9; | |
const np = 1 - p; | |
const newCards = 15; | |
const ease = 2.5; | |
const max = 1200; | |
const secondsPerCard = 6; | |
const queue = [{baseDays: 5, factor: 1}]; | |
let total = 0; | |
while (queue.length > 0) { | |
const {baseDays, factor} = queue.shift(); | |
if (baseDays > max || factor < 0.0001) { | |
continue; | |
} | |
total += factor; | |
queue.push({baseDays: baseDays * ease, factor: factor * p}, {baseDays: Math.max(5, baseDays / ease), factor: factor * np}); | |
} | |
const totalCards = total * newCards; | |
console.log(`Total cards to review: ${totalCards}. Review time: ${totalCards * secondsPerCard / 60}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment