CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

examples: if

Text// Check if next square is empty before stepping:

void go()
{
if(Tracer.seenowall())
{
// do this only if next square is clear
Tracer.step();
}
}
 
or...

 

void go()

{

if(Tracer.seenowall())
{
// do this only if next square is clear
Tracer.mark(4);
Tracer.step();
Tracer.say("OK");
}
}