var g_crash=new Image();
g_crash.src='images/crash.png';
var g_ctx;
var g_side=0;
var g_x0, g_y0, g_step;
var g_x, g_y, g_h;
var g_pattern='41523';
var g_numbers=g_pattern.split('');
var g_i, g_j, g_k;
var g_img=[];
for (var i=0;i<4;i++) {
  g_img[i]=new Image();
  g_img[i].src='images/'+i+'.png';
}
var g_robot;
var g_timer;
var g_running=false;
