CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

Draw a line ... of any size!

This is how you draw a line of ...

... size 2 in any color: ... size whatever:
void line(int color)
{
Tracer.mark(color);
Tracer.step();
Tracer.mark(color);
Tracer.step;
}
void line(int whatever, int color)

{

for (int size=1;size<=whatever;size++)

{

Tracer.mark(color);
Tracer.step();

}

}