Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
51
Task/Simple-turtle-graphics/Logo/simple-turtle-graphics.logo
Normal file
51
Task/Simple-turtle-graphics/Logo/simple-turtle-graphics.logo
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
to rectangle :width :height
|
||||
repeat 2 [
|
||||
forward :height
|
||||
left 90
|
||||
forward :width
|
||||
left 90 ]
|
||||
end
|
||||
|
||||
to square :size
|
||||
rectangle size size
|
||||
end
|
||||
|
||||
to triangle :size
|
||||
repeat 3 [
|
||||
forward size
|
||||
right 120 ]
|
||||
end
|
||||
|
||||
to house :size
|
||||
left 90
|
||||
square size
|
||||
triangle size
|
||||
right 90
|
||||
end
|
||||
|
||||
to max :lst
|
||||
if equalp count lst 1 [ output first lst ]
|
||||
make "x max butfirst lst
|
||||
if x > first lst [ output x ]
|
||||
output first lst
|
||||
end
|
||||
|
||||
to barchart :lst :size
|
||||
right 90
|
||||
if emptyp lst [ stop ]
|
||||
make "scale size / (max lst)
|
||||
make "width size / count lst
|
||||
foreach lst [
|
||||
rectangle ? * scale width
|
||||
forward width ]
|
||||
back size
|
||||
left 90
|
||||
end
|
||||
|
||||
clearscreen hideturtle
|
||||
house 150
|
||||
penup
|
||||
right 90 forward 10 left 90
|
||||
pendown
|
||||
barchart [ 0.5 0.33333 2 1.3 0.5 ] 200
|
||||
left 90 back 10 right 90
|
||||
Loading…
Add table
Add a link
Reference in a new issue