0
我在Inform7中實現了一個沒有任何擴展名的電話。Inform7中嵌套的If-Conditions
Calling is an action applying to one topic.
Understand "Call [text]" or "[text] call" as calling.
Carry out Calling:
if the topic understood matches "Melissa":
say "You are calling Melissa … 'are you fine?'";
if player consents:
say "good???";
otherwise:
say "I see!";
if the topic understood matches "Dad":
say "Hey boy";
otherwise:
say "beeeeep – [the topic understood] is not answering";
所以,如果我叫爸爸的程序工作。但是,如果我叫梅利莎,她回答問題,當玩家同意,整個過程失敗:
>call melissa
You are calling Melissa … 'are you fine?'
yes
good???
beeeep -
*** Run-time problem P39: Attempt to say a snippet value which is currently invalid: words 2 to 2.
is not answering
>
@khelwood的問題似乎是,他正在運行的最後一個「否則」即使條件「梅麗莎」有匹配... – 18zehn
那當然是這種情況。如果你不想那樣,那麼你的'如果主題理解匹配'爸爸'應該是'否則如果...' – khelwood