Skip to content
Sign upLog in
← Back to Community

Survival Game Original

Profile icon
elizurfk

A super cool survival game that you can do multiple choices in

Voters
Profile icon
elizurfk
Comments
hotnewtop
Profile icon
Coder100

Nice! Just a question, why do you have your if statements be like:

if oof==('1'):

when you can optimize down to:

if oof == '1':
Profile icon
elizurfk

@Coder100
Oh, thanks! I will use that in my upgrade! By the way I didn't know that you could do that

Profile icon
Coder100

lol its precedence :D

@elizurfk

Profile icon
Coder100

@elizurfk
like, i don't think many people do: (5 / 6) + 3, obv 5 / 6 + 3 is the same because PEMDAS

Profile icon
elizurfk

@Coder100
... ok...

Profile icon
DynamicSquid

Cool! One question though:

if __name__ == '__main__': os.execv(sys.executable, ['python'] + sys.argv)

what does that do?

Profile icon
elizurfk

@DynamicSquid
It makes the program restart.

Profile icon
DynamicSquid

@elizurfk
What does the if statement do? Would it work without it?

Profile icon
elizurfk

@DynamicSquid
Without the statement, the thing could work; all you would have to do is to press run after.

Profile icon
DynamicSquid

@elizurfk
oh okay