arwer13 / compsci

2 stars 1 forks source link

Understanding Anki's speced-repetition algorithm #8

Open arwer13 opened 8 years ago

arwer13 commented 8 years ago

This is Anki's spaced-repetition system (for flashcards): https://github.com/dae/anki/blob/master/anki/sched.py

RyanMcCarl commented 8 years ago

Modules imported:

from future import division import time import random import itertools from operator import itemgetter from heapq import *

arwer13 commented 8 years ago

Oh, I've got this wasn't a question but would leave it here :) Note that __future__ is transformed into future by github Markdown processor. There are multiple ways to format text as code in markdown:

In python 2 and python 3 integer division works differently:

Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
>>> 3/4
0
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
>>> 3/4
0.75

In Python2 future module is intended to allow to write more Python 3 compatible code, so this import changes behavior of integer division. Another future feature we've encountered is from __future__ import print_function.

RyanMcCarl commented 8 years ago

That's helpful, thanks!

arwer13 commented 8 years ago

I've started studying Anki's repetition algorithm, planning to represent it with some sort of flow diagram in time. I'm also going to try to describe the way I reverse-engineered it and maybe leave some gaps in the algorithm for you.

RyanMcCarl commented 8 years ago

That sounds perfect, thanks. I'll post issues with syntax I don't understand.

RyanMcCarl commented 8 years ago

It would be nice to build a simple implementation of it with no GUI.

arwer13 commented 8 years ago

There GUI is separated from this logic, so it can be used more or less as it is.