0
The toggle is a device.
The toggle is switched on.
If the toggle is switched on:
    say "Hi there.".

The third line shows an error about punctuation, saying the phrase doesn't make sense. How is the punctuation wrong, it seems completely fine?

4

1 回答 1

4

错误消息有点误导,但核心问题是您需要 if 短语的上下文。换句话说,你需要定义什么时候应该检查条件,否则就太模糊了。

目前尚不完全清楚您希望代码做什么,但您可以拥有例如:

Every turn:
    if the toggle is switched on:
        say "Hi there."
于 2018-08-17T22:18:15.773 回答