summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2017-01-27 08:33:22 +0100
committerEduardo Pedroni <e.pedroni91@gmail.com>2017-01-27 08:33:22 +0100
commit9d45ae4034d1ef7999a598f6a5b2433632e92ed6 (patch)
tree91935b32edf1a2e44b458db39ca322d5ac11566a
parente793093be40e84625ca0d806cd6058bb33d73b17 (diff)
parentf90daf96cd79bcdc72a8d76b3ab0484f64aad1b3 (diff)
Merge branch 'master' of github.com:epedroni/flashcards
-rwxr-xr-xflashcards14
1 files changed, 8 insertions, 6 deletions
diff --git a/flashcards b/flashcards
index caf51d8..1cbcfc6 100755
--- a/flashcards
+++ b/flashcards
@@ -3,7 +3,7 @@
import re
import sys
from pathlib import Path
-from random import randint
+from random import shuffle
cardRegex = "CARD: "
prefixLength = 6
@@ -48,11 +48,12 @@ def extractCards(f):
# Loops serving cards to the user until the program is exited
def serveCards(cards):
while True:
- card = cards[randint(0, len(cards) - 1)]
- print(card[0])
- input()
- print(card[1])
- input()
+ for card in cards:
+ print("----------------------------------------------------------------------------")
+ print(card[0])
+ input()
+ print(card[1])
+ input()
def debugCards(cardList):
for c in cardList:
@@ -62,6 +63,7 @@ def debugCards(cardList):
def main():
files = getFileList()
cards = createCardList(files)
+ shuffle(cards)
serveCards(cards)
if __name__ == "__main__":