Maze Compute
Create an array of instructions for the robotic vehicle to follow one by one.
Once started it keeps moving, so be sure to turn and not crash!
Powered by CMGame Engine
github.com/tlong314/cmgame
Create an array of instructions for the robotic vehicle to follow one by one.
Once started it keeps moving, so be sure to turn and not crash!
/**
* Turns the tank until it
* faces the other direction.
*/
function turn_around()
{
// turning right ends the same
turn_left();
turn_left();
}
/**
* Moves forward, side, forward
* @param way - "right" or "left"
*/
function zigzag( way )
{
wait(1);
if(way is "left")
{
turn_left();
wait(1);
turn_right();
}
else
if(way is "right")
{
turn_right();
wait(1);
turn_left();
}
wait(1);
}
/**
* Moves up and to the side
* @param way - "right" or "left"
*/
function turn_corner( way )
{
wait(1);
if(way is "left")
{
turn_left();
}
else
{
turn_right();
}
wait(1);
}
/**
* Curls around a wall
* @param way - "right" or "left"
*/
function go_around( way )
{
wait(1);
if(way is "left")
{
turn_left();
wait(1);
turn_left();
}
else
if(way is "right")
{
turn_right();
wait(1);
turn_right();
}
wait(1);
}