Simple turtle graphics: Difference between revisions
Content added Content deleted
(→{{header|Python}}: added "translated from") |
m (remove hueshift()) |
||
Line 26: | Line 26: | ||
Rectangle(🐢, siz, siz) |
Rectangle(🐢, siz, siz) |
||
# roof |
# roof |
||
HueShift(🐢) |
|||
Reposition(🐢, x - siz / 2, y - siz / 2) |
Reposition(🐢, x - siz / 2, y - siz / 2) |
||
Turn(🐢, -60) |
Turn(🐢, -60) |
||
Line 35: | Line 34: | ||
doorheight, doorwidth = siz / 2, siz / 4 |
doorheight, doorwidth = siz / 2, siz / 4 |
||
Pencolor(🐢, 0, 0, 0) |
Pencolor(🐢, 0, 0, 0) |
||
HueShift(🐢) |
|||
Reposition(🐢, x, y + doorheight / 2) |
Reposition(🐢, x, y + doorheight / 2) |
||
Rectangle(🐢, doorwidth, doorheight) |
Rectangle(🐢, doorwidth, doorheight) |
||
# window |
# window |
||
windowheight, windowwidth = siz /3, siz / 4 |
windowheight, windowwidth = siz /3, siz / 4 |
||
HueShift(🐢) |
|||
Reposition(🐢, x + siz / 4, y - siz / 4) |
Reposition(🐢, x + siz / 4, y - siz / 4) |
||
Rectangle(🐢, windowwidth, windowheight) |
Rectangle(🐢, windowwidth, windowheight) |
||
Line 59: | Line 56: | ||
for n in data # draw each bar in chart |
for n in data # draw each bar in chart |
||
barheight = n * siz / maxdata |
barheight = n * siz / maxdata |
||
HueShift(🐢) |
|||
Reposition(🐢, x, y - barheight / 2) |
Reposition(🐢, x, y - barheight / 2) |
||
Rectangle(🐢, barwidth, barheight) |
Rectangle(🐢, barwidth, barheight) |