here's the py file

master
Boyana 2 years ago
parent a125f56661
commit 9a9cc58234

@ -1,13 +1,34 @@
#This is a script that writes rules and instructions #This is a script that writes rules and instructions
#First it sets variables #First it sets variables
import random import random
games = ["backgammon", "pokemon", "war"] #games = ["backgammon", "pokemon", "war"]
object = ["teammate", "card", "turn", "place", "board", "dice", "nice", "backgammon"] #Pull the content from games.txt
verb = ["choose", "pick", "give", "burn", "cut"] #Open games.txt file
#Read the game name list from the games.txt file
#Make a game name list
gamenames = open("text/games.txt").read().split("\n")
print(type(gamenames))
print(gamenames)
#Read the verbs list from the verbs.txt file
#Make a verbs list
verbs = open("text/verbs.txt").read().split("\n")
print(type(verbs))
print(verbs)
#Read the objects list from the objects.txt file
#Make a objects list
objects = open("text/object.txt").read().split("\n")
print(type(objects))
print(objects)
#object = ["teammate", "card", "turn", "place", "board", "dice", "nice", "backgammon"]
#verb = ["choose", "pick", "give", "burn", "cut"]
#Then it writes a title #Then it writes a title
print("How to play " + random.choice(games)) print("How to play " + random.choice(gamenames))
#Then it loops through instructions #Then it loops through instructions
for i in range(6): for i in range(6):
print("Rule " + str(i+1) + ": "+ random.choice(verb) + " a " + random.choice(object)) print("Rule " + str(i+1) + ": "+ random.choice(verbs) + " a " + random.choice(objects))

Loading…
Cancel
Save