summaryrefslogtreecommitdiffstats
path: root/flashcards
diff options
context:
space:
mode:
Diffstat (limited to '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__":