import os import time import random def loadDecks(source=os.getcwd()+"\decks.txt"): #assumes the deck is named "deck.txt" file=open(source,"r") #and is in same directory as the script deck1=[] deck2=[] line=file.readline().strip() while line!="%": deck1+=[line] line=file.readline().strip() line=file.readline().strip() while line!="%":#% is a sentinal value deck2+=[line] line=file.readline().strip() file.close() return [deck1,deck2] def makeTopic(deck1, deck2): topic=random.choice(deck2) nounnum=topic.count("_") #the 4 line blanks are replaced with one line blanks nouns=[] while len(nouns).5: time.sleep(.5) t-=.5 cyc+=1 if cyc==20: cyc=0 print("time:",t) time.sleep(t) print(" ") print("Time up! 1 point awarded!") print(" ") return 1 except: print(" ") print("Current player has failed. No points awarded") print(" ") return 0 def play(players,points,roundlength,deck1,deck2): score=[] turn=0 for x in range(players): score+=[0] while max(score)players-1): turn = 0 print(" player | score") for x in range(len(score)): print(" %i | %i "%(x+1,score[x])) print(" ") turn-=1 if turn<0: turn=players-1 print("player",turn+1,"wins!!!") print("press enter to exit") input() decks=loadDecks() n=int(input("number of players? ")) print(" ") play(n,5,90.0,decks[0],decks[1])