"Saying" too much causes spell to stop


#1

Playing around with a simple step 1 solution to Gridmancer and the spell would not complete - it was stopping after drawing 51 rectangles.
I played with it a bit and noticed when I commented out the say it would successfully complete drawing 54 rectangles.

var grid = this.getNavGrid().grid;

for(var y = 0; y < grid.length - tileSize; y += tileSize) 
{
    for(var x = 0; x < grid[y].length - tileSize; x += tileSize) 
    {
        if(grid[y][x].length === 0) 
        {
            var newX = x + tileSize/2;
            var newY = y + tileSize/2;
            var newW = tileSize;
            for (var x2 = x + tileSize; x2 < grid[y].length - tileSize; x2 += tileSize )
            {
                if(grid[y][x2].length > 0)
                {
                    x = x2;
                    break;
                }
                newX += tileSize/2;
                newW += tileSize;
            }
            this.addRect( newX, newY, newW );
            //this.say ("("+ newX + "," + newY + "):" +newW);
            this.wait();
        }
    }
}

#2

Each this.say() takes a certain amount of time to complete (longer than the default this.wait()), and the Gridmancer level is currently capped at, I think, 60 seconds. So that’s why. Having the level end after a certain amount of time makes a lot more sense in other levels, I think.