Simple turtle graphics: Difference between revisions

→‎{{header|XPL0}}: Moved turtle the proper way for bar graph.
(Added XPL0 example.)
(→‎{{header|XPL0}}: Moved turtle the proper way for bar graph.)
Line 1,197:
 
=={{header|XPL0}}==
[[File:TurtleXPL0.gif|right]]
<syntaxhighlight lang "XPL0">
def ScrW=320, ScrH=200;
Line 1,233 ⟶ 1,232:
proc BarGraph(List, Len, Size);
real List; int Len; real Size;
real PosX0;
int N;
def BarWidth = 0.4;
[for N:= 0 to Len-1 do
[PosX0:= PosX;
for N:= 0 to Len-1 do
[Rectangle(Size*BarWidth, List(N)*Size);
MoveTo(Size*BarWidth);
];
MoveTo(-Size*BarWidth*float(Len));
PosX:= PosX0;
];
 
Line 1,270 ⟶ 1,267:
House(80.0);
Pen:= Up; MoveTo(10.0); Pen:= Down;
BarGraph([0.5, 1.0/3.0, 2.0, 1.3, 0.5], 5, 5045.0);
]</syntaxhighlight>
{{out}}
[[File:TurtleXPL0.gif|rightleft]]
</br>
 
=={{header|Yabasic}}==
295

edits