logoalt Hacker News

Jtsummersyesterday at 9:00 PM1 replyview on HN

Not Bob Martin, sudoku with TDD was Ron Jeffries.

https://news.ycombinator.com/item?id=3033446 - Linking to this old comment because it links to each of Ron's articles, a discussion about it, and Norvig's version.


Replies

hinkleyyesterday at 11:02 PM

Hah! That's probably why I can never find it.

Norvig's solution is a work of art. When people ask me for examples of intrinsic versus accidental complexity, his sudoku solver is the best one I have. My only note is that he gives up and goes brute force early. When I first encountered it I had a lot of fun layering other common solving strategies on top of his base without too much extra trouble.

What I did not have fun with is porting it to elixir. That was a long journey to get to a solution I could keep adding stuff too. Immutable data is rough, particularly when you're maintaining 4 distinct views on the same data.