Tomorrow is the Big Day
After waiting for almost half a year, I’ve finally relocated to San Francisco and am now waiting for DBC to start tomorrow morning. Aside from showing up at 9am sharp, we have no further instructions or any idea of what to expect.
My self-imposed ticket-to-entry was to implement a basic Sudoku solver using Test-Driven-Development. I finished it just yesterday. Check out the code here. Writing tests first was slow going initially and even felt unnatural at the start, but looking back, I think it’s clear that Much Pain Was Avoided by using tests. I love TDD.
Aside from getting comfortable writing tests using MiniTest, I struggled with how to represent a puzzle in memory. An array? A two dimensional array? A hash? And so I did take a peek at The Ruby Programming Language which starts off by presenting a Sudoku solver implementation. As it turns out, the authors use a one-dimensional array with an accompanying setter and getter to make manipulating the puzzle fairly easy.
Once I saw how the pros represented the puzzle, though, I closed the book and struggled through the implementation on my own. The process was invaluable as a learning experience. In other words, Dear Reader, the Hard Way is the Only Way. How else do you learn something if not sweating the details?
Now I am letting my mind rest while waiting for tomorrow’s adventure to begin.