Here are some other sudoku solvers that give more insight into the coder than the problem:
Sudoku in APL: https://www.youtube.com/watch?v=DmT80OseAGs
Test driven sudoku: http://ronjeffries.com/xprog/articles/sudokumusings/
Here are some other sudoku solvers that give more insight into the coder than the problem:
Sudoku in APL: https://www.youtube.com/watch?v=DmT80OseAGs
Test driven sudoku: http://ronjeffries.com/xprog/articles/sudokumusings/
In any case, I'm replying to your comment because it applies to me. Norvig's code is compact and elegant, whereas mine is spaghetti code at best. I basically have lots of control statements, as there are many many processing steps that I painstakingly discovered as I went along (thousands of lines). Heck, I can barely remember them myself.
Here's my site: http://sudokuisland.com
To be fair, the reason Norvig was so successful was he knew exactly the sort of problem soduku was and how to solve it, whereas Ron lacked this background knowledge.
In TDD your test will always predate your understanding. So it forces you to solve (part of) the problem in your head first, rather than combine the act of problem-solving and writing. And you do this over and over again. And when you change your mind about something, you have twice the code to refactor.
It's a difference between recording your thinking in code and actually thinking in code.
This reminds me of an old article that exemplifies this: http://insideofthebox.tumblr.com/post/52002125683/prime-fact...
Prime factor kata is often used as an introductory example of TDD, yet it is clearly impractical and produces garbage code. Not to mention that I've actually seen people do it, stumble, and hectically reach for their notes to see what's the next step. And it's a pretty darn simple problem.