Quick actions

cmd+k|ctrl+k

Navigation

Languages

Truchet Tiles Simplified and Edited

Snippet info

Language

Nim

Visibility

public

Author

bluecinderbox91-the-g.o.a.t.

Created

2020-02-02T22:45:29Z

Updated

2020-02-02T22:45:29Z

reset
st

to tile0 :s
    pu
    fw :s
    pd
    repeat 2 [
    pd
    rt 90
    arc :s/3 90 
    pu
    fw :s
    ]
    bw :s/3
    rt 90
    pd 
    fw :s
    lt 90
    pu
    fw :s/3
    lt 90
    fw :s/2
    lt 180
    pd
    arc :s/6 180
    pu 
    bw :s/2
    rt 90
    pd
end

 
to tile1 :s
    lt 90
    repeat 2 [
    pd
    rt 90
    arc :s/3 90 
    pu
    fw :s
    ]
    bw :s/3
    rt 90
    pd 
    fw :s
    lt 90
    pu
    fw :s/3
    lt 90
    fw :s/2
    lt 180
    pd
    arc :s/6 180
    pu 
    bw :s/2
    rt 180
    bw :s
    pd
end
    
to tile2 :s
    pu
    fw :s
    rt 90
    fw :s
    lt 90
    pd
    rt 90
    repeat 2 [
    pd
    rt 90
    arc :s/3 90 
    pu
    fw :s
    ]
    bw :s/3
    rt 90
    pd 
    fw :s
    lt 90
    pu
    fw :s/3
    lt 90
    fw :s/2
    lt 180
    pd
    arc :s/6 180
    pu 
    bw :s/2
    rt 90
    fw :s
    lt 90
    pd
end


to tile3 :s
    pu
    fw :s
    rt 90
    fw :s/2
    lt 90
    pd
    rt 90
    arc :s/6 180
    pu
    fw :s/2
    rt 90
    pu
    fw :s/2
    pd
    arc :s/6 180
    pu
    fw :s/2
    rt 90
    fw :s
    rt 90
    pd
    arc :s/3 90
    arc 2*:s/3 90
    lt 180
    pu 
    bw :s
    lt 90
    fw :s
    rt 90
    fw :s
    rt 180
    pd
end
 

to tile4 :s
    rt 90
    pu
    fw :s/3
    pd
    lt 90
    fw :s
    pu
    rt 90
    fw :s/3
    rt 90
    pd
    fw :s
    pu
    lt 90
    fw :s/3
    lt 90
    fw :s/3
    lt 90
    pd
    fw :s
    rt 90
    pu
    fw :s/3
    rt 90
    pd
    fw :s
    rt 90
    pu
    fw 2*:s/3
    pd 
    rt 180
end 


to tile5 :s
    pu
    rt 90
    fw :s/2
    lt 90
    pd
    lt 90
    arc :s/6 180 
    pu 
    fw :s/2
    rt 90
    pu 
    fw :s/2
    pd
    arc :s/6 180
    pu 
    fw :s/2
    rt 90
    fw :s
    rt 90
    pd
    arc :s/3 90
    arc 2*:s/3 90
    lt 180
    pu
    bw :s
    pd
end


to tile :n
setxy 0 500
repeat:n[
  repeat :n[
  make "r rand 6
  if :r = 0
  [tile0 500/:n]
  if :r = 1
  [tile1 500/:n]
  if :r =  2
  [tile2 500/:n]
  if :r =  3
  [tile3 500/:n]
  if :r =  4
  [tile4 500/:n]
  if :r =  5
  [tile5 500/:n]
]
pu
fw 500/:n
lt 90
fw 500
rt 90
pd
]
end
tile 20
INFO