DKL9 GitList
Repositories
DKL9 home
memoire
Code
Commits
Branches
Tags
Search
Tree:
eb7971e
Branches
Tags
master
memoire
review.lua
Adds functions for review mechanics
John Smith
commited
eb7971e
at 2021-325 22:03:58
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 prompt.delay = 2 * (revtime - prompt.time) else prompt.delay = 64 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 }