-
-
Save csokol/1e183928fa2370806ae1 to your computer and use it in GitHub Desktop.
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
- 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 |
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
Teste 1: 5 acertos (EASY) e um erro | |
Hora atual: 2014-11-05T11:53:56.419 | |
Estado depois de 5 easys | |
Dias até a próxima exibiçao da carta: 195.3125 | |
Data da próxima exibição: 2015-09-23T16:53:56.413 | |
----- | |
Estado depois de um blackout | |
Data da próxima exibição: 2014-11-05T12:03:56.428 | |
Dias até a próxima exibiçao da carta: 2.0 | |
================== | |
Teste 2: um erro e 3 acertos | |
Hora atual: 2014-11-05T11:54:42.277 | |
Estado depois de um blackout | |
Data da próxima exibição: 2014-11-05T11:55:42.283 | |
Dias até a próxima exibiçao da carta: 2.0 | |
----- | |
Estado depois de 3 easy | |
Dias até a próxima exibiçao da carta: 31.25 | |
Data da próxima exibição: 2014-12-24T05:55:42.283 | |
================== | |
Teste 3: 6 acertos | |
Hora atual: 2014-11-05T11:55:05.825 | |
Estado depois de 1 easy | |
Dias até a próxima exibiçao da carta: 5.0 | |
Data da próxima exibição: 2014-11-10T11:55:05.820 | |
----- | |
Estado depois de 2 easy | |
Dias até a próxima exibiçao da carta: 12.5 | |
Data da próxima exibição: 2014-11-22T23:55:05.820 | |
----- | |
Estado depois de 3 easy | |
Dias até a próxima exibiçao da carta: 31.25 | |
Data da próxima exibição: 2014-12-24T05:55:05.820 | |
----- | |
Estado depois de 4 easy | |
Dias até a próxima exibiçao da carta: 78.125 | |
Data da próxima exibição: 2015-03-12T08:55:05.820 | |
----- | |
Estado depois de 5 easy | |
Dias até a próxima exibiçao da carta: 195.3125 | |
Data da próxima exibição: 2015-09-23T16:55:05.820 | |
----- | |
Estado depois de 6 easy | |
Dias até a próxima exibiçao da carta: 365.0 | |
Data da próxima exibição: 2016-09-22T16:55:05.820 | |
----- | |
================== | |
Teste 4: hard, good, easy | |
Hora atual: 2014-11-05T11:55:25.007 | |
Estado depois de 1 hard | |
Dias até a próxima exibiçao da carta: 2.4 | |
Data da próxima exibição: 2014-11-07T21:55:25.003 | |
----- | |
Estado depois de 1 good | |
Dias até a próxima exibiçao da carta: 5.1 | |
Data da próxima exibição: 2014-11-13T00:55:25.003 | |
----- | |
Estado depois de 1 easy | |
Dias até a próxima exibiçao da carta: 12.75 | |
Data da próxima exibição: 2014-11-25T18:55:25.003 | |
================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment