From 578090bf724b8f183a962c6c52dbd4ac2d5545cc Mon Sep 17 00:00:00 2001 From: Boyana Date: Tue, 8 Nov 2022 16:48:45 +0100 Subject: [PATCH] adding tools --- script.py | 6 +++++- text/object.txt | 1 + text/tools.txt | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 text/tools.txt diff --git a/script.py b/script.py index 05ad43a..60d41c0 100644 --- a/script.py +++ b/script.py @@ -1,6 +1,7 @@ #This is a script that writes rules and instructions #First it sets variables import random +import urllib.request #games = ["backgammon", "pokemon", "war"] #Pull the content from games.txt #Open games.txt file @@ -19,6 +20,9 @@ verbs = open("text/verbs.txt").read().split("\n") #Read the objects list from the objects.txt file #Make a objects list objects = open("text/object.txt").read().split("\n") +#Waiting to be fixed <<<< +#tools = urllib.request.urlopen("http://pad.xpub.nl/p/SI19-prototyping-7-tools/export/txt").read().split("\n") +tools = open("text/tools.txt").read().split("\n") def spaceremover (defspace): for object in defspace: if object == "": @@ -53,7 +57,7 @@ print(" " *10+"How to play " + random.choice(gamenames)) print("~*"*30) #Then it loops through instructions for i in range(random.randrange(1,275)): - print(" " *10+"Rule " + str(i+1) + ": "+ random.choice(verbs) + " " + quantifier (objects)) + print(" " *10+"Rule " + str(i+1) + ": "+ random.choice(verbs) + " " + quantifier (objects) + " with a " + random.choice(tools)) print(""" wWWWw wWWWw diff --git a/text/object.txt b/text/object.txt index e5d7a4b..267aaf4 100644 --- a/text/object.txt +++ b/text/object.txt @@ -16,3 +16,4 @@ soil parasite page sound +hour \ No newline at end of file diff --git a/text/tools.txt b/text/tools.txt new file mode 100644 index 0000000..22e76dc --- /dev/null +++ b/text/tools.txt @@ -0,0 +1,17 @@ +your hand +someone else's hand +someone +drawing +collage +poem +statement +song +casette +speech +gesture +python script +html script +card +movie +story +tale \ No newline at end of file