function draw_polygon(sides) {
    var i;
    for (i = 0; i < sides; i++) {
        var angle = 360/sides;
        mirobot.left(angle);
        mirobot.forward(100);
    }
}

mirobot.pendown();
draw_polygon(5);
mirobot.penup();

Controlling Mirobot with Javascript

Use these simple commands to get started controlling Mirobot: