Java StarLogo
2.0
english
`turtle`
to setup
seth 0
if (who = 0)
   [setc red
    setxy x1 y1]
if (who = 1)
   [setc blue
    setxy x2 y2]
end

to go
fd 1
ifelse pc = black
 [stamp color
  rt 90]
 [stamp black
  lt 90]
end


`observer`
to setup
ca
crt 2
ask-turtles [setup]
end


`information`
In this simple program, each ant takes a step forward, toggles the color of the square it lands on, and turns left or write depending on the square's original color.  Complex patterns emerge from this simple rule.  

Try experimenting with the initial positions of the ants to see different patterns result.


`interface`
SLCanvas
top-left 5 233

SLButton
turtle-or-observer? turtle
top-left 30 124
width-height 79 44
name "button2"
line-to-run "go"
forever? true
button-number 3
show-name? false
whichip 3

SLButton
turtle-or-observer? observer
top-left 30 28
width-height 79 44
name "button1"
line-to-run "setup"
forever? false
button-number 2
show-name? false
whichip 4

SLSlider
top-left 94 20
width-height 90 25
name "slider0"
variable "x1"
min-value -50
max-value 50
current-value 20
slider-number 0
show-name? false

SLSlider
top-left 94 124
width-height 90 25
name "slider2"
variable "x2"
min-value -50
max-value 50
current-value -17
slider-number 2
show-name? false

SLSlider
top-left 134 125
width-height 90 25
name "slider3"
variable "y2"
min-value -50
max-value 50
current-value -9
slider-number 3
show-name? false

SLSlider
top-left 133 21
width-height 90 25
name "slider1"
variable "y1"
min-value -50
max-value 50
current-value 24
slider-number 1
show-name? false


`turtle shapes`
[encoded data, 5200 characters]
DhUAABUO2Q==

`template`
null

`settings`
patch-size 4
num-shapes 256
screen-half-width 50
screen-half-height 50
interface-window-xcor 252
interface-window-ycor 119
interface-window-size 651 417
output-window-xcor 0
output-window-ycor 0
output-window-width 300
output-window-height 219
info-window-xcor 0
info-window-ycor 0
info-window-width 500
info-window-height 419
control-center-xcor 14
control-center-ycor 130
control-center-width 345
control-center-height 491
turtle-command-center-height 140
observer-command-center-height 143

`string table`
H4sIAAAAAAAAAGNgYGAAABzfRCEEAAAAAAAABA==

`symbol table`
H4sIAAAAAAAAAGNgYGAAABzfRCEEAAAAAAAABA==

`double table`
H4sIAAAAAAAAAGNgYGBy0GMAA4coBzANACOlQTEUAAAAAAAAFA==

`list table`
H4sIAAAAAAAAADWKyREAIAwCl6gPW7T/QoQxPpjlAiYgQZlbCbzQPpuqP9ZwvbrP
fj4NLqevtjRQAAAAAAAAUA==

`bytecodes`
H4sIAAAAAAAAAG1QQQ6CMBCctrRoMMCBRjQeiHryCZ6MLyEq8SYmwME/6p8stIWi
bLLJ7nZmdroI8surLq7lrajyE95tfABw8Kqom6cqI/SxVUlMnXoARQeFD+dBBVO5
Ey2VdwgrdRggFi1TEJmYnoDESyMbmJlqZGxqBrK3XE/XUuh1EXV0+ISOcHR8R2f2
p6NtE9B7qQabCc8LkAQTnoXyEAIJc7yvtC7Ve+0/Bow6o1yb3czspgjOTV2Xj2OW
dSbmP7em41tHwjwyhD3RHt1yRtFiv+c+4vT8AQAAAAAB/A==

`observer world`
H4sIAAAAAAAAAGMQSMhPKk4tKkstUiguSSxJTXBggAMrBq6CnPyS8syU9NQSIJ+F
gS0nNS+9JAPI5mBgB8kVpOaBlXKDNSPJQgAjCAMA+OWZc2QAAAAAAABk

`patch world`
[encoded data, 31460 characters]
DZ3KcJ37BAAABPud

`turtle world`
H4sIAAAAAAAAAGPgSygpLSrJSVUoLkksSU1wYICD+QxsOal56SUZQLYFA2tSUWpq
CpCpwsBVkJNfUp6Zkp5aAuSbMLCD+AWpeUCOHgNrcn5OfhGQKcPAUpkMZvEwcIMN
RzKNA6g8Jb88rwDIM2JgLc5ILEgFMrUYWCogelgYmMsz8sHuYCvOgKo0ZmDPSE1M
ycxLB3JEYO78DwRAignEdnCCiDnYQOmwBgitx4AJGIGQAYL3f4AIHRBB0xflgFMf
AC+7/Ew7AQAAAAABOw==

