DKL9 GitList
Repositories
DKL9 home
memoire
Code
Commits
Branches
Tags
Search
Tree:
920c809
Branches
Tags
master
memoire
review.lua
Change scheduling algorithm
John Smith
commited
920c809
at 2021-349 21:29:44
review.lua
Blame
History
Raw
--[[ stuff to help with the review mechanics ]] --[[ manipulates `Prompt` `prompt` in-place as it should be when reviewed at timestamp `revtime` with review success `revsucc` ]] local function update(prompt, revtime, revsucc) if revsucc then local ad = revtime - prompt.time prompt.delay = 2 * ad + math.max(40000 - 0.5 * ad, 0) prompt.succ = prompt.succ + 1 else prompt.delay = 30 prompt.fail = prompt.fail + 1 end prompt.time = revtime end --[[ checks (returns boolean) if `Prompt` `prompt` should be reviewed now ]] local function should(prompt) return os.time() - prompt.time >= prompt.delay end return { update = update, should = should }