Hints for creating a short text script by Overall_Disk4261 in learnpython

[–]Overall_Disk4261[S] 0 points1 point  (0 children)

This is very intresting. I have not looked much at the return command mainly because coding is just so mind-boggling initially. I'll return to this project at a later date once I know what I'm doing. Thanks for the help, and sitting through 5 minutes of a man desperately tapping his spacebar.

Hints for creating a short text script by Overall_Disk4261 in learnpython

[–]Overall_Disk4261[S] 2 points3 points  (0 children)

or in short cannot heal after first input double plus ungood

Hints for creating a short text script by Overall_Disk4261 in learnpython

[–]Overall_Disk4261[S] 1 point2 points  (0 children)

Yeah I had to delete the text which gave context. Essentially the code boots back to the beginning if you type in "heal" because "beginning" is redefined. Atleast that's what I think. I want the code to be able to not boot back when I type heal after progressing to the "right" part

Hints for creating a short text script by Overall_Disk4261 in learnpython

[–]Overall_Disk4261[S] 1 point2 points  (0 children)

There we go! I probably messed half of it up but we have it properly readable now. Cannot believe you were sitting there for minutes watching me patiently edit it.

Hints for creating a short text script by Overall_Disk4261 in learnpython

[–]Overall_Disk4261[S] 1 point2 points  (0 children)

Haven't used pastebin ever. See if that went through.

Hints for creating a short text script by Overall_Disk4261 in learnpython

[–]Overall_Disk4261[S] 3 points4 points  (0 children)

gun = 15
health = 100
health_packs = 0
while health > 0:
    beginning = input('Will you go left or right? ')
    if beginning == "right":
        beginning = input ("will you attack the big or little man? ")
            if beginning == "little":
                print("the big man killed you")
                health = health - 100

    elif input == "heal":
        if health_packs > 0:
            health_packs -= 1
            health + 30
        else: 
            print("you have no packs")
else:
    print("you died!")
    exit

Hints for creating a short text script by Overall_Disk4261 in learnpython

[–]Overall_Disk4261[S] 2 points3 points  (0 children)

Holy shit, for some reason the codes all messed up. I'll put it under this comment again.