Skip to content

Instantly share code, notes, and snippets.

@guilhermesilveira
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save guilhermesilveira/4bdac29f40680af4da7a to your computer and use it in GitHub Desktop.
Save guilhermesilveira/4bdac29f40680af4da7a to your computer and use it in GitHub Desktop.
sm2
- double
- em horas
newInterval = 48
initialStepSmall = 1minute
initialStepBig = 10minutes
easyBonus = 1.3
maximumInterval = 36500
card {
easiness = 2.5
currentInterval = newInterval (horas)
bool relearning = false
int currentCorrectStreak
DateTime nextShowTime
bool isLearning() {
currentCorrectStreak = 0
}
func nextInterval(button) {
if button == AGAIN {
easiness *= 0.8
easiness = max[1.3, easiness]
currentInterval = newInterval
if isLearning {
nextShowTime = now + initialStepSmall
} else {
relearning = true
nextShowTime = now + initialStepBig
}
currentCorrectStreak = 0
return
} else {
currentCorrectStreak++
if isRelearning {
isRelearning = false
nextShowTime = now + currnetInterval
return
}
}
previousInterval = currentInterval
if button == HARD {
currentInterval *= 1.2
easiness *= 0.85
}
if button == GOOD {
currentInterval *= easiness
}
if button == EASY {
currentInterval *= easiness * easyBonus
easiness *= 1.15
}
currentInterval = min[currentInterval, maximumInterval]
currentInterval = max[previousInterval + 24, currentInterval]
nextShowTime = now + currentInterval
}
}
view: isRelearning : so dois botoes. isNotRelearning: 4 botoes
FUTURO : timezone
@csokol
Copy link

csokol commented Nov 4, 2014

nunca vai ficar no minimo (https://gist.github.com/guilhermesilveira/4bdac29f40680af4da7a#file-gistfile1-txt-L65) né? porque o unico jeito de diminuir o current interval é dando blackout...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment