Last night was the 8th Coding Dojo. Joh kindly allowed myself and Jay to try out one based on Ruby instead of the usual Java. Sadly, Jay was ill and couldn’t make it. Get well soon, Jay.
We started late because I was installing all the necessary bits (ruby + eclipse) on Joh’s laptop…
Having done that, I gave a quick presentation comparing Ruby to Java. I had been under the impression that most people there would be familiar with Java (based on previous experiences). Unfortunately, because it was Ruby it attracted a very different crowd. Thankfully, nobody seemed to mind too much.
After that, we started on the task: write a Sudoku solver. This was the point where I realised that whilst I’d brought along code for a board, I hadn’t actually brought a puzzle to solve. Ooops. So we hopped over to Wikipedia to grab a sample puzzle. And we then realized I needed an importer… So we knocked one up fairly quickly. Whilst I did feel quite embarrassed about lacking such a crucial part of the problem (bad prep! no cookie!), it turned out to be an interesting example of coding something simple. The fact that I was with Andy, who I know well helped a lot.
Unfortunately, as the evening progressed, it became rapidly clear that none of us had much clue about how to solve a Sudoku puzzle algorithmically. So most of the time ended up being spent discussing the problem as opposed to coding. Afterwards, it was suggested that a “time out” be taken so we could discuss the strategy as a group—that might have helped quite a bit.
Finally, the last pair on the keyboard started making real headway. Andy and James came up with an algorithm for listing the “opportunities” for a given cell and were in the middle of implementing it when the final whistle blew.
So we didn’t get very far at all towards a solver. But as usual the journey was interesting and entertaining.