Skip to content

Instantly share code, notes, and snippets.

@narthur
Created May 13, 2016 22:38
Show Gist options
  • Save narthur/462ec178a98c5cde18a5c5d66e08ca88 to your computer and use it in GitHub Desktop.
Save narthur/462ec178a98c5cde18a5c5d66e08ca88 to your computer and use it in GitHub Desktop.
Have a list of problems? Want to memorize it Cram.com-style? This is the script for you.
#!/usr/bin/python
import sys
from random import randint
quantity = int(sys.argv[1])
cards = [False] * quantity
def memorize(cards):
while False in cards:
i = randint(0,quantity-1)
if not cards[i]:
print i+1
response = raw_input('Good? y/n: ').lower()
if (response == 'y'): cards[i] = True;
memorize(cards)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment