There is a task Write a text quest. Write Using only if, elife, else. For example, in the plot, the player chooses one of two actions. If he chose if, the game continues, and if the second condition, the program should display the end of the game and all, i.e. Next, it does not continue and no messages no longer. How to do it with cycles I know. But I use only conditional operators – no. Is there any similarity Break?
Answer 1, Authority 100%
maybe it will not be comfortable, but try using the flag, for example
go = o #GameOver IF Go! = 1 and someelse: SomeCode. ELIF Go! = 1 and someelse: # In this condition, the player lost SomeCode. go = 1. Print ('Hamper') ELIF GO! = 1 AND SOMEELSE: SomeCode. ELSE: SomeCode.
Please explain to me how to check out the code in the comments)
You can complete the process of executing your quest when it is necessary with
import sys sys.exit ()
You can also give a comment comment from the program
import sys sys.exit ("You Dead")
This action will complete the execution of the script at all