0

我正在尝试使用通知 7 编写一篇交互式小说,我想在其中为玩家做出选择,我想要一个简单的是或否我使用了以下代码:

if the player consents say "You get a better view of the stranger."

Otherwise:
say "You can't make out what's happening clearly, however, you notice the stranger walking out of the pub" 

然后我收到这个无用的错误消息:

你写了“如果玩家同意说“你可以更好地了解陌生人。”:但我找不到一个我知道如何处理的动词。这看起来像是一个“如果”的短语,它已经滑倒了,所以我忽略了它。('If' 短语,像所有其他此类指令一样,属于规则或短语的定义 - 不是没有上下文的句子。可能不小心使用了句号或跳过的行而不是分号,所以你无意中结束了最后一个早点统治?)

任何帮助将不胜感激。

4

1 回答 1

2

标点已关闭。短语应以分号结尾,如果短语应使用 begin..end 块或“冒号和缩进”样式。所以要么:

if the player consents begin;
say "You get a better view of the stranger.";
otherwise;
say "You can't make out what's happening clearly, however, you notice the stranger walking out of the pub";
end if;

或者

    if the player consents:
        say "You get a better view of the stranger.";
    otherwise:
        say "You can't make out what's happening clearly, however, you notice the stranger walking out of the pub";

请注意第二个示例中的冒号、分号和制表符。

此外,正如错误消息所述,您需要指定何时应提出该问题。如果短语必须在规则或短语内。例如,如果问题应作为行动的结果提出:

After examining the stranger for the first time:
    say "Move closer?";
    if the player consents begin;
    say "You get a better view of the stranger.";
    otherwise;
    say "You can't make out what's happening clearly, however, you notice the stranger walking out of the pub";
    end if;
于 2016-03-06T23:05:48.177 回答