在 Python 中,我们像这样用反斜杠将一长行代码分成多行代码。
a = 5
b = 11
print(str(a) + " plus " + \
str(b) + " is " + \
str(a + b))
# prints "5 plus 11 is 16"
Run Code Online (Sandbox Code Playgroud)
我们如何在 NetLogo 中做到这一点?
NetLogo 不关心多行,除了注释(注释标记;只持续到行尾)。所有这些都是一样的:
to testme
; single line
let a 25 print a
; command per line
let b 20
print b
; unreadable
let
c
15
print
c
end
Run Code Online (Sandbox Code Playgroud)