Last active
August 29, 2015 14:08
-
-
Save guilhermesilveira/4bdac29f40680af4da7a to your computer and use it in GitHub Desktop.
sm2
This file contains hidden or 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
- 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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...