You can generate graphical output in a separate window using the following graphics commands.
clear(); drawLine( x1, y1, x2, y2 ); drawBox( x1, y1, width, height ); drawTriangle( x1, y1, x2, y2, x3, y3 ); drawEllipse( x1, y1, w, h ); setColour( r, g, b ); setBGColour( r, g, b ); fill( true/false );
clear()
clears the graphics window to the current background colour. If you don't
set this using setBGColour()
then it will be cleared using the default background
colour, which is black.
All co-ordinates and sizes are integers.
The origin is in the top left hand corner.
The colour commands ( NB colour has a 'u' in it ) take integer r,g and b values.
fill
takes either true or false to turn filling of shapes on or off, by default filling is off.