Drawing Library
Functions
lab1.cpp File Reference
#include <iostream>
#include <fstream>

Functions

void start ()
 
void penup ()
 
void go (int x, int y)
 
void left (int n)
 
void right (int n)
 
void up (int n)
 
void down (int n)
 
void pendown ()
 
void end ()
 

Function Documentation

◆ down()

void down ( int  n)

Moves the pen's position "down" (increases the y coordinate).

Example: down(10) will move the pen's position down 10 spots (y will change by 10).

Parameters
nThe number of steps to move down.

◆ end()

void end ( )

Indicates the end of your drawing.

◆ go()

void go ( int  x,
int  y 
)

Moves the pen's position to the given coordinate.

Example: go(10, 5) will cause the pen's position to change to (10,5).

Parameters
xThe x coordinate to move to.
yThe y coordinate to move to.

◆ left()

void left ( int  n)

Moves the pen's position "left" (decreases the x coordinate).

Example: left(10) will move the pen's position to the left 10 spots (x will change by -10).

Parameters
nThe number of steps to move left.

◆ pendown()

void pendown ( )

Sets the pen down so that using go() or the other movement functions will cause a line to be drawn until penup() is called.

◆ penup()

void penup ( )

Lifts the pen so the go() and the other functions may be invoked without causing a line to be drawn.

◆ right()

void right ( int  n)

Moves the pen's position "right" (increases the x coordinate).

Example: right(10) will move the pen's position to the right 10 spots (x will change by 10).

Parameters
nThe number of steps to move right.

◆ start()

void start ( )

Indicates the start of your drawing.

◆ up()

void up ( int  n)

Moves the pen's position "up" (decreases the y coordinate).

Example: up(10) will move the pen's position up 10 spots (y will change by -10).

Parameters
nThe number of steps to move up.