问题描述
在Python中,我们将一长行代码分成多个带有反斜杠的代码行,
a = 5
b = 11
print(str(a) + " plus " + \
str(b) + " is " + \
str(a + b))
# prints "5 plus 11 is 16"
我们如何在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