Second Day of the Craftsman Swap

15 Apr 2009

Day Two of the Craftsmanship Swap:

The day started off with a bit of work on slim for C with Doug Bradbury. Slim is a replacement for Fit which underlies Fitnesse and you need to write one for every language you plan to use FitNesse on. I gave it my best shot , but then Uncle Bob (Bob Martin - father of 8th Light founder Micah Martin) and James Grenning showed up. Great to see those guys – I don’t think I’ve seen James since my days of apprenticeship at Object Mentor. They are crazy better at C than I am so they worked with Doug while I paired with Micah on drving that ui through Fitnesse (which I talked about yesterday). We made some pretty good progress but he had some meetings to attend so I got to work with 8th Light’s newest apprentice: Colin Jones. Guess what he was working on?

Tic Tac Toe.

That takes me back. 5 years ago almost to the month, Micah had me write a Tic Tac Toe program to see if I had the skills to become an Object Mentor apprentice. Well Colin cleared the same bar and now he’s moved on to 3 dimensional Tic Tac Toe. Think of a Rubick’s cube with X’s and O’s inside the cubes. Three in a row still wins, but in any direction. Turns out there’s about a trillion different outcomes to a 3D cube so brute force solving is not going to work unless you have some time. Looking 4 moves ahead took about a third of a second, and 5 moves took 6 seconds. Looking at all possible moves and then choosing ones that lead to victory would take insane amounts of time. So we brainstormed some alternatives. You could let the computer chug away and build a massive database of all possible solutions – not super practical. Or you could approach it like chess: Have some pre-defined moves for the early game and a way of evaluating positions for the mid to late game. That way you can limit the depth of your search and still make ok decisions. We talked for awhile about what positions are valuable, but along the way we realized that 3D Tic Tac Toe is a terrible game. If you move first and take the center of the cube you’re going to win in about 5 moves. If you don’t take the center of the cube your opponent will and they’ll take slightly longer to win – but win they will. Draw it out for yourself and see. When Micah got back from his meeting we chatted about this and agreed that although there’s merit in learning how to tell a machine to play 3D Tic Tac Toe, some of the fun of doing it is spoiled by the game itself. So Colin’s switched over to 4x4 Tic Tac Toe (or is it Tic Tac Toe Tim?) for now but may return to the third dimension sometime in the future.

Btw, Micah’s cell phone ring tone is “Damn it feels good to be a gangster.” It does indeed.