Hi Elllen,

Thanks for the pointer to jslint. I will install it asap. :)

The updated version of the tutorial is
on file://localhost/Users/nanli/Code.org/github/blockly-nan/static/karel/maze.html?page=1

I haven't added the tower levels. I will do that once I have this pull
request fixed.

btw, I have also made changes to the mode_id. I will send another pull
request on that and send it for you to review. Thanks you!

Best,
Nan


On Thu, Sep 5, 2013 at 2:17 PM, Ellen Spertus <notifications@github.com>wrote:

> In static/karel/maze.js:
>
> > @@ -908,6 +929,21 @@ Maze.schedulePutDownBall = function() {
> >    }
> >  };
> >
> > +// Set the image based on the number of balls in the location.
> > +Maze.setBallImage = function(ballIcon, x, y) {
> > +  if (Maze.balls_[y][x] > 10) {
> > +    ballIcon.setAttributeNS(
> > +      'http://www.w3.org/1999/xlink', 'xlink:href', Maze.SKIN.ball);
> > +  } else if (Maze.balls_[y][x] < -10) {
> > +    ballIcon.setAttributeNS(
> > +      'http://www.w3.org/1999/xlink', 'xlink:href', '-' + Maze.SKIN.ball);
> > +  } else {
> > +    ballIcon.setAttributeNS(
> > +      'http://www.w3.org/1999/xlink', 'xlink:href',
> > +      Maze.balls_[y][x] + Maze.SKIN.ball);
> > +  }
> > +}
>
> FYI, we catch some of these mistakes automatically with "jslint", the rest
> with Neil. :-)
> … <#140effd5aae1a9db_>
> On Thu, Sep 5, 2013 at 2:15 PM, tobyk100 <notifications@github.com>
> wrote: In static/karel/maze.js: > @@ -908,6 +929,21 @@
> Maze.schedulePutDownBall = function() { > } > }; > > +// Set the image
> based on the number of balls in the location. > +Maze.setBallImage =
> function(ballIcon, x, y) { > + if (Maze.balls_[y][x] > 10) { > +
> ballIcon.setAttributeNS( > + 'http://www.w3.org/1999/xlink',
> 'xlink:href', Maze.SKIN.ball); > + } else if (Maze.balls_[y][x] < -10) { >
> + ballIcon.setAttributeNS( > + 'http://www.w3.org/1999/xlink',
> 'xlink:href', '-' + Maze.SKIN.ball); > + } else { > +
> ballIcon.setAttributeNS( > + 'http://www.w3.org/1999/xlink',
> 'xlink:href', > + Maze.balls_[y][x] + Maze.SKIN.ball); > + } > +} Semicolon
> after functions when they are being assigned to a variable. — Reply to this
> email directly or view it on GitHub<
> https://github.com/code-dot-org/blockly/pull/14/files#r6194606> .
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/code-dot-org/blockly/pull/14/files#r6194683>
> .
>