From 83b3f0784309db0b5548596e65cd5d48b494fda8 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Thu, 18 Apr 2013 12:42:13 +0300 Subject: PEP 8 police: Wrapped long strings to less than 80 characters --- weatbag/tiles/e2.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'weatbag/tiles/e2.py') diff --git a/weatbag/tiles/e2.py b/weatbag/tiles/e2.py index ca66475..a71ef96 100644 --- a/weatbag/tiles/e2.py +++ b/weatbag/tiles/e2.py @@ -25,7 +25,8 @@ class Tile: if do[1] == "correctly": print("You sly dog, you!") print("The dwarf hands you a torch! " - "He then suddenly vanishes, leaving behind a pile of dust.") + "He then suddenly vanishes, " + "leaving behind a pile of dust.") self.contents['unlit torch'] -= 1 player.give('unlit torch') return @@ -40,12 +41,14 @@ class Tile: print("You guessed my lucky number in %d guesses!" % (self.guess_count)) print("The dwarf hands you a torch! " - "He then suddenly vanishes, leaving behind a pile of dust.") + "He then suddenly vanishes, " + "leaving behind a pile of dust.") self.contents['unlit torch'] -= 1 player.give('unlit torch') except: print("Please try guessing a number, like 'guess 7'.") elif (do[0] in words.take): - print("You can't have my prize, you have to guess the lucky number!") + print("You can't have my prize, " + "you have to guess the lucky number!") else: print("Sorry, I don't understand.") -- cgit v1.3 From 9d8fa73a4fcec72f21c03de7adb77b7fa03a6c07 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Thu, 18 Apr 2013 13:34:32 +0300 Subject: Checks for challenge completion before complaining about "take" --- weatbag/tiles/e2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weatbag/tiles/e2.py') diff --git a/weatbag/tiles/e2.py b/weatbag/tiles/e2.py index a71ef96..eb7a2e2 100644 --- a/weatbag/tiles/e2.py +++ b/weatbag/tiles/e2.py @@ -47,7 +47,7 @@ class Tile: player.give('unlit torch') except: print("Please try guessing a number, like 'guess 7'.") - elif (do[0] in words.take): + elif (do[0] in words.take) and (self.contents['unlit torch'] == 1): print("You can't have my prize, " "you have to guess the lucky number!") else: -- cgit v1.3 From 097c58ba0f3204410208eca92a4c7f3dbc37fe0f Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Thu, 18 Apr 2013 15:08:29 +0300 Subject: added a comment for clarity --- weatbag/tiles/e2.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'weatbag/tiles/e2.py') diff --git a/weatbag/tiles/e2.py b/weatbag/tiles/e2.py index eb7a2e2..68798b3 100644 --- a/weatbag/tiles/e2.py +++ b/weatbag/tiles/e2.py @@ -47,6 +47,9 @@ class Tile: player.give('unlit torch') except: print("Please try guessing a number, like 'guess 7'.") + + #if action is "take" AND there is still a dwarf around to complain, + #then complain. elif (do[0] in words.take) and (self.contents['unlit torch'] == 1): print("You can't have my prize, " "you have to guess the lucky number!") -- cgit v1.3