Simple turtle graphics: Difference between revisions

m
m (→‎{{header|Julia}}: orientation)
m (→‎{{header|Julia}}: reposition)
Line 21:
function house(🐢, x, y, siz)
oldorientation = 🐢.orientation
xpos, ypos = 🐢.xpos, 🐢.ypos
# house wall
Reposition(🐢, x, y)
Line 45 ⟶ 46:
Rectangle(🐢, windowwidth, windowheight)
Orientation(🐢, oldorientation)
Reposition(🐢, xpos, ypos)
end
 
function barchart(🐢, data, x, y, siz)
oldorientation = 🐢.orientation
xpos, ypos = 🐢.xpos, 🐢.ypos
maxdata = maximum(data)
# scale to fit within a square with sides `siz` and draw bars of chart
Line 62 ⟶ 65:
end
Orientation(🐢, oldorientation)
Reposition(🐢, xpos, ypos)
end
 
4,102

edits