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