私はPythonを学んでおり、以下はwhileループを含むpythonゲーム関数ですが、このループは無限ループとして機能しており、それがどのように機能し、どのように機能するべきかを理解できません。
ここでの while ループの意味と、「bear_move=False」変数とループ条件「WHILE TRUE」との関係を説明してください。ここでの while ループの構造と条件、およびこの while ループの条件が関連する条件を理解できません。
def bear_room():
print "There is a bear here."
print "The bear has a bunch of honey."
print "The fat bear is in front of another door."
print "How are you going to move the bear?"
bear_moved=False
while True: #What is this while loop means here
next=raw_input("You should write take honey or taunt bear: >")
if next=="take honey":
print "The bear looks at you then pimp slaps your face off."
elif next=="taunt bear" and not bear_moved:
print "The bear has moved from the door. You can go through it now."
bear_moved=True
elif next=="taunt bear" and bear_moved:
print "The bear gets pissed off and chews your crotch off."
elif next=="open door" and bear_moved:
gold_room()
else:
print "I got not I dea what that means."