Java StarLogo
2.0
english
`turtle`
turtles-own [current-depth]

to tree
treestep
end

to treestep
if current-depth = 0 [stop]
setcurrent-depth current-depth - 1
fd dist
hatch [rt angle + (random variation) - ((random variation) / 2) treestep]
hatch [lt angle + (random variation) - ((random variation) / 2) treestep]
die
end


to grow
setcurrent-depth current-depth - 1
fd dist
hatch [rt angle + (random variation) - ((random variation) / 2)]
hatch [lt angle + (random variation) - ((random variation) / 2)]
die
end


`observer`
to setup 
ca crt 1
ask-turtles
 [setxy X-coord Y-coord setc green pd
  setcurrent-depth depth
  seth 0]
end


`information`
for more information about this project, see: 
http://education.mit.edu/starlogo/projects/tree.html


`interface`
SLCanvas
top-left 6 233

SLButton
turtle-or-observer? turtle
top-left 46 5
width-height 111 31
name "Complete Tree"
line-to-run "tree"
forever? false
button-number 1
show-name? true
whichip 4

SLButton
turtle-or-observer? observer
top-left 11 7
width-height 109 31
name "button2"
line-to-run "setup"
forever? false
button-number 2
show-name? false
whichip 5

SLButton
turtle-or-observer? turtle
top-left 82 4
width-height 110 31
name "One step at a time"
line-to-run "grow"
forever? false
button-number 3
show-name? true
whichip 6

SLSlider
top-left 81 124
width-height 90 25
name "slider3"
variable "depth"
min-value 0
max-value 10
current-value 5
slider-number 3
show-name? false

SLSlider
top-left 146 122
width-height 90 25
name "slider5"
variable "Y-coord"
min-value -80
max-value 80
current-value -45
slider-number 5
show-name? false

SLSlider
top-left 115 122
width-height 90 25
name "slider4"
variable "X-coord"
min-value -80
max-value 80
current-value 0
slider-number 4
show-name? false

SLSlider
top-left 125 16
width-height 90 25
name "slider6"
variable "variation"
min-value 0
max-value 100
current-value 30
slider-number 6
show-name? false

SLSlider
top-left 15 123
width-height 90 25
name "slider1"
variable "dist"
min-value 1
max-value 30
current-value 15
slider-number 1
show-name? false

SLSlider
top-left 47 123
width-height 90 25
name "slider2"
variable "angle"
min-value 0
max-value 179
current-value 14
slider-number 2
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 190
interface-window-ycor 68
interface-window-size 657 420
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 21
control-center-ycor 69
control-center-width 337
control-center-height 494
turtle-command-center-height 129
observer-command-center-height 126

`string table`
H4sIAAAAAAAAAGNgYGAAABzfRCEEAAAAAAAABA==

`symbol table`
H4sIAAAAAAAAAGNgYGAAABzfRCEEAAAAAAAABA==

`double table`
H4sIAAAAAAAAAGNgYGBigAIH7wYwDQD8/MiqFAAAAAAAABQ=

`list table`
H4sIAAAAAAAAAGNgYGBhYGBgZ2RgYARiFiBmZYKwmYGYAYShgA/Gh2JGJJoJiNmg
mAmdD1TGQ6oeANi5O96YAAAAAAAAmA==

`bytecodes`
H4sIAAAAAAAAAIVTQU7DMBBcO0lTkkKjSCkBDljAK+CC4A4XHtACFkKiTdW6QvwR
/sQ6tteJU4SlSLP22DM7sSGfP38p+dK8yu38Fr71+AGAFJKtVLs1wnOgcYEfs7iO
AbgGlZ1jwK7cOje4Gtk6Qlzg57hxh5sAlMxi5Fd1S4dLxFO9iGy1kbI1RSM1KjRa
JoOxZm6V1L4f/Kr1zMrMey2O7QFc7zaaU+79EzdCLiPf3mtie5zYc2bUg+8tbTEr
cK5wc2OaM/UBYqtRnQw7075qHmhkHY18j8Yk0DjsaJz+rVG7JDnEb5vmE8ubf1Jk
lJhPJgqSKff+9aHrUeA67SfTS6LspUlJDs7MgjPzfhKDziOY3e2UalbXQtw3y/WH
VFI8mfuX2OTcEwDTCNZHtMe9mqR3XbvcM+I+rqTQl1UslFgI9b7sikThxl/yXJMk
qwMAAAAAA6s=

`observer world`
H4sIAAAAAAAAAGMQSMhPKk4tKkstUiguSSxJTXBggAMrBq6CnPyS8syU9NQSIJ+F
gS0nNS+9JAPI5mBgB8kVpOaBlXKDNSPJQgAjCAMA+OWZc2QAA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