How to break a long code line into multiple lines in NetLogo?

Viewed 263

In Python, we break a long line of code into multiple code lines with backslash like this.

a = 5
b = 11
print(str(a) + " plus " + \
      str(b) + " is " + \
      str(a + b))
# prints "5 plus 11 is 16"

How do we do that in NetLogo?

1 Answers

NetLogo doesn't care about multiple lines except for comments (the comment marker ; only lasts to the end of the line). All of these are the same:

to testme
  ; single line
  let a 25 print a
  ; command per line
  let b 20
  print b
  ; unreadable
  let
  c
  15
  print
  c
end
Related