Loading...

Powered by CMGame Engine
github.com/tlong314/cmgame

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!

Skip Tutorial
Start engine:
Enter the number of steps to wait (while advancing) before receiving next instruction.






This function calls a set
of other instructions.

Functions can be written in
different ways, but this code can
give you an idea about what will
happen when the function is called.




/**
 * 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);
}
New Level Reached!

Level 0