touque.ca > Education Commons > Turing

Drawing Procedures

Notes:

  1. include setscreen ("graphics") as the first executable line of code
  2. the origin of the coordinate grid (0, 0) is at the bottom left of the run window
  3. the axes run from the origin to maxx and maxy
  4. procedures without fill in their names produce a figure outlined in the specified colour
  5. procedures with fill in their names produce a figure filled with the specified colour

Basics

drawdot (x, y, colour)

drawline (x1, y1, x2, y2, colour)

Boxes & rectangular figures

drawbox (bottom-x, bottom-y, top-x, top-y, colour)
drawfillbox (bottom-x, bottom-y, top-x, top-y, colour)

drawmapleleaf (bottom-x, bottom-y, top-x, top-y, colour)
drawfillmapleleaf (bottom-x, bottom-y, top-x, top-y, colour)

drawstar (bottom-x, bottom-y, top-x, top-y, colour)
drawfillstar (bottom-x, bottom-y, top-x, top-y, colour)

Ovals & arcs

drawoval (x, y, x-radius, y-radius, colour)
drawfilloval (x, y, x-radius, y-radius, colour)

drawarc (x, y, x-radius, y-radius, starting-angle, ending-angle, colour)
drawfillarc (x, y, x-radius, y-radius, starting-angle, ending-angle, colour)

Advanced

drawfill (x, y, fill-colour, border-colour)

drawpolygon (x-array, y-array, number-of-points, colour)

touque.ca > Education Commons > Turing

[This page last updated 2020-12-23 at 12h13 Toronto local time.]