Created
May 13, 2016 22:38
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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