Loop1
  globals [glob1]
  to foo loop [ if glob1 = 10 [ stop ] set glob1 glob1 + 1 ] end
  O> foo
  glob1 => 10

Foreach1
  O> foreach [1 2 3] [ crt ? ]
  count turtles => 6

Foreach2
  O> (foreach [1 2 3] [4 5 6] [ crt (?1 + ?2) ])
  count turtles => 21

Run1
  O> run "crt 10"
  count turtles => 10
  T> die
  O> run "crt 10 [ set color red ]"
  count turtles with [color = red] => 10

Run2
  to foo [a] run "set color a" end
  O> crt 1 [ foo blue ]
  [color] of turtle 0 = blue => true

Run3
  to foo [a] run "foreach [ 1 2 3 ] [ask turtles with [ who = ? ][ set color a ] ]" end
  O> crt 4 [ set color green ]
  O> foo blue
  count turtles with [ color = blue ] => 3
  [color] of turtle 0 = green => true

Run4
  globals [glob1]
  O> set glob1 0
  O> foreach [1 2 3] [ crt ? set glob1 glob1 + runresult "count turtles" ]
  glob1 => 10
  count turtles => 6

Run5
  globals [glob1]
  O> set glob1 0
  O> foreach [1 2 3] [ crt ? run "set glob1 glob1 + count turtles" ]
  glob1 => 10
  count turtles => 6

Run6
  globals [glob1]
  O> set glob1 0
  O> run "(foreach [ 1 2 3 ] [ 2 4 6 ] [ set glob1 ( glob1 + ?1 + ?2 ) ])"
  glob1 => 18

Run7
  globals [glob1]
  to foo [a] foreach [1] [ run "set glob1 5" ] end
  O> foo 0
  glob1 => 5

Run8
  globals [glob1]
  O> set glob1 "5"
  runresult glob1 => 5
  [runresult glob1] of one-of patches => 5

While
  O> random-seed 272
  O> crt 10
  O> while [any? turtles] [ ask one-of turtles [ die ] ]
  any? turtles => false

NestedWithoutInterruption
  O> without-interruption [ without-interruption [ crt 10 [ without-interruption [ set color red ] ] ] ]
  count turtles with [color = red] => 10

IfElse
  O> ifelse 2 + 2 = 4 [ crt 10 ] [ crt 20 ]
  O> ifelse 2 + 2 = 5 [ crt 3  ] [ crt  4 ]
  count turtles => 14

RecursiveReporter1
  to-report fact [n] ifelse n = 0 [ report 1 ] [ report n * fact (n - 1) ] end
  fact 0 => 1
  fact 1 => 1
  fact 2 => 2
  fact 3 => 6
  fact 4 => 24
  fact 5 => 120

RecursiveReporter2
  to-report fact [n] report ifelse-value (n = 0) [1] [n * fact (n - 1)] end
  fact 0 => 1
  fact 1 => 1
  fact 2 => 2
  fact 3 => 6
  fact 4 => 24
  fact 5 => 120

