--[[ 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 }