Are you for Roomba?

Last week there was a woot-off. I try not to splurge – woot-offs are dangerous – but they put up a refurbished Roomba at a fairly decent price. My wife and I had just agreed days earlier to save up and buy one to alleviate some of our regular vacuuming, so it had to be a sign.

It arrived yesterday, and thus far the pandemonium has been incredible. It took its standard 60 minutes to map the living room / dining room / front hallway and, in the process, spook-out the cats. Watching it navigate around the furniture was like watching my CS 115 professor explain how we were going to write our first somewhat complex recursive method in java - finding a route through a maze.

You know, something like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public boolean solve (int row, int column) {
    boolean done = false;
    if (valid(row, column)) {
        grid[row][column] = 5;
        if (row == grid.length-1 && column == grid[0].length-1)
            done = true;
        else {
            done = solve(row+1, column);        // down
            if (!done)
                done = solve(row, column+1);    // right
            if (!done)
                done = solve(row-1, column);    // up
            if (!done)
                done = solve(row, column-1);    // left
        }
        if (done)
            grid[row][column] = 7;
    }
    return done;
}

Admittedly, I'm enjoying SyntaxHighlighter a bit too much. This particular model lets you set a schedule for when it should go about its business, which is very convenient since it means we can set it to terrorize the cats clean the house while we're at work.

Dec 14th, 2007

Comments