Java StarLogo
2.0
english
`turtle`
turtles-own [point]

to setup-trap
   stamp-at 30 40 red
   stamp-at -30 40 blue
   stamp-at -40 -40 green
   stamp-at 40 -40 violet
end

to play-trap
   setpoint random 4
   case point
   [
    0 [seth (towards-nowrap 10 40)
       fd .5 * (distance-nowrap 10 40)
       stamp white]
    1 [seth (towards-nowrap -10 40)
       fd .5 * (distance-nowrap -10 40)
       stamp white]
    2 [seth (towards-nowrap -40 -40)
       fd .5 * (distance-nowrap -40 -40)
       stamp white]
    3 [seth (towards-nowrap 40 -40)
       fd .5 * (distance-nowrap 40 -40)
       stamp white]
   ]
end

to setup-eq
   stamp-at 30 20 red
   stamp-at -30 20 blue
   stamp-at 0 -36 green
end

to play-eq
   setpoint random 3
   case point
   [
    0 [seth (towards-nowrap 30 20)
       fd .5 * (distance-nowrap 30 20)
       stamp white]
    1 [seth (towards-nowrap -30 20)
       fd .5 * (distance-nowrap -30 20 )
       stamp white]
    2 [seth (towards-nowrap 0 -36)
       fd .5 * (distance-nowrap 0 -36)
       stamp white]
   ]  
end

to setup-right
   stamp-at 30 45 red
   stamp-at -20 45 blue
   stamp-at -20 -45 green
end
to play-right
   setpoint random 3
   case point
   [
    0 [seth (towards-nowrap 30 45)
       fd .5 * (distance-nowrap 30 45)
       stamp white]
    1 [seth (towards-nowrap -20 45)
       fd .5 * (distance-nowrap -20 45)
       stamp white]
    2 [seth (towards-nowrap -20 -45)
       fd .5 * (distance-nowrap -20 -45)
       stamp white]  
   ] 
end


`observer`


`information`
WHAT IS IT? --------------- 
This project displays three different ways to create a Sirpinski  shape: equilateral triangle, right triangle, and trapezoid. 

HOW TO USE IT --------------- 
Click the RESTART button any time you want to create a shape.  Click the SETUP and then the PLAY button pair for whichever  shape you prefer.  Be sure to click the RESTART button again before starting another shape.


`interface`
SLCanvas
top-left 9 206

SLButton
turtle-or-observer? observer
top-left 20 56
width-height 44 30
name "restart"
line-to-run "ca crt 1"
forever? false
button-number 2
show-name? true
whichip 6

SLButton
turtle-or-observer? turtle
top-left 109 98
width-height 72 30
name "button9"
line-to-run "play-right"
forever? true
button-number 10
show-name? false
whichip 7

SLButton
turtle-or-observer? turtle
top-left 75 105
width-height 59 30
name "button8"
line-to-run "setup-right"
forever? false
button-number 9
show-name? false
whichip 8

SLButton
turtle-or-observer? turtle
top-left 106 5
width-height 63 30
name "button7"
line-to-run "play-eq"
forever? true
button-number 8
show-name? false
whichip 9

SLButton
turtle-or-observer? turtle
top-left 73 12
width-height 50 30
name "button6"
line-to-run "setup-eq"
forever? false
button-number 7
show-name? false
whichip 10

SLButton
turtle-or-observer? turtle
top-left 193 49
width-height 72 31
name "button3"
line-to-run "play-trap"
forever? true
button-number 4
show-name? false
whichip 11

SLButton
turtle-or-observer? turtle
top-left 157 52
width-height 66 32
name "trapezoid"
line-to-run "setup-trap "
forever? false
button-number 3
show-name? false
whichip 12


`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 232
interface-window-ycor 91
interface-window-size 641 422
output-window-xcor 0
output-window-ycor 0
output-window-width 300
output-window-height 219
info-window-xcor 16
info-window-ycor 385
info-window-width 500
info-window-height 419
control-center-xcor 38
control-center-ycor 99
control-center-width 312
control-center-height 497
turtle-command-center-height 143
observer-command-center-height 142

`string table`
H4sIAAAAAAAAAGNgYGAAABzfRCEEAAAAAAAABA==

`symbol table`
H4sIAAAAAAAAAGNgYGAAABzfRCEEAAAAAAAABA==

`double table`
H4sIAAAAAAAAAGNgYOB20GMAgwN2ENohygHCd4HyvRsgdMwBMG3/AKpeBUo7QWkT
KO0GUQ8A1D/WRVwAAAAAAABc

`list table`
H4sIAAAAAAAAAIWQsQ7CMBBDnbQcTdWRgQlWlvz/7+FTbOnEwmDpJZc6LwVwALga
8GI+nQumiTuzKbv2km889m5rDyWnzoSZGUzj3t0zs2b1jjBrtpU7w5wzrHk6P4pz
cm9rfaQz8ame6unvwlw83RNme5beMP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