Share your repls and programming experiences

← Back to all posts
Work - Part 2
robowolf (41)

Part 2 to my Work Text Adventure Game. There's no bug that I know of. Enjoy. -RoboWolf

Commentshotnewtop
Axrevyn (223)

A couple of tips:
All throughout the file you put this:

t= input('')

From what I can tell, you use it just to make sure it pauses until the player presses Enter. You can simply replace that with this:

input()

When you do this, it won't define a variable or anything, it will simply wait for the player to press Enter before continuing (which is what I assume you were trying to accomplish).
That method makes it a lot neater and doesn't force you to have a pointless variable.

Line 139 (and others) doesn't have a color assigned to it, but it still has colored attached to the front.

Other than that, it's an interesting story, even if there is a little bit of overuse of punctuation. I look forward to part 3!!!!!!!!!

robowolf (41)

@Axrevyn You just made life easier. Thx a lot.

Axrevyn (223)

@robowolf
To prevent an error, I suggest using a loop (it might be kind of pointless, but I ran into that error the first time I ran this program)

This...

n = input('')

...can be changed into this...

while True:
 n = input().lower()
 if n == "surgery" or n == "pluck it out":
  break
 else:
  pass

...which will prevent the error if you accidentally enter nothing.

(Slightly improved version)
while True:
  n = input().lower()
  if n in ["surgery", "pluck it out", "pluck", "do surgery"]:
    break
  else:
    pass
tankerguy1917 (38)

robowolf, there is a bug. it says File "main.py", line 75 in <module>
if choice1 == "Success":
NameError: name 'choice1' is not defined

robowolf (41)

@tankerguy1917 Yeah. After the question you're supposed to type the answer and then hit enter. Sorry for the confusion.

robowolf (41)

@tankerguy1917 You're Welcome. Again sorry for the confusion.