text: var Vector = function(x,y){
      this.x = x;
      this.y =y;
      this.plus = function(v){
          this.x += v.x;
          this.y += v.y;
      },
      this.times = function(t){
          return new Vector(this.x*t,this.y*t);
      }
  };
  
  var logo = {
      canvas:null,
      context:null,
      cursor:new Vector(250,250),
      direction:new Vector(0,1),
      rotate :0,
      pen : false,
      penDown:function(){this.pen = true;},
      penUp:function(){this.pen = false;},
      init:function(){
          this.canvas =document.getElementById("canvas0");
          this.context=this.canvas.getContext("2d");
      },
      turn:function(r){
          this.rotate += r;
          this.direction.x = Math.sin(this.rotate*3.14159/180);
          this.direction.y = Math.cos(this.rotate*3.14159/180);
      },
      move :function(t){
          if(this.pen){
              this.context.beginPath();
              this.context.moveTo(this.cursor.x,this.cursor.y);
          }
          this.cursor.plus(this.direction.times(t));
          if(this.pen){
              this.context.lineTo(this.cursor.x,this.cursor.y);
              this.context.stroke();
          }
      },
      printpos :function(){
          alert('hoge: '+this.cursor.x+","+this.cursor.y);
      }
  };
  
  var move = function(t){logo.move(t)};
  var turn= function(r){logo.turn(r)};
  var penDown= function(){logo.penDown()};
  var penUp = function(){logo.penUp()};