From 543c15b3ca114b551b38846726a447384916204b Mon Sep 17 00:00:00 2001 From: aglaia Date: Tue, 8 Nov 2022 15:41:37 +0100 Subject: [PATCH] i fixed the bug in thw quantifier function --- script.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script.py b/script.py index 70b3e2b..e0e3457 100644 --- a/script.py +++ b/script.py @@ -30,7 +30,11 @@ verbs = spaceremover(verbs) gamenames = spaceremover(gamenames) #new funtion quantifier def quantifier (words): + amount = random.randint(-5,7) word = random.choice(words) + word = str(amount) + " " + word + if amount == 1 or amount == -1: + return word if word[-1] =="y": word = word[0:-1] #word = word.replace("y","") @@ -47,5 +51,5 @@ print(" " *10+"How to play " + random.choice(gamenames)) print("~*"*30) #Then it loops through instructions for i in range(6): - print(" " *10+"Rule " + str(i+1) + ": "+ random.choice(verbs) + " a " + quantifier (objects)) + print(" " *10+"Rule " + str(i+1) + ": "+ random.choice(verbs) + " " + quantifier (objects))