Knuth on Sudoku
www-cs-faculty.stanford.edu
www-cs-faculty.stanford.edu
I love the idea of transforming Sudoku to another problem that already has a good solution instead of trying to attack it from scratch.
As a general principal, it's always a good idea to see if the problem you are facing resembles other known, solved problems.
And a C version: http://gist.github.com/319391
I don't mean to be rude, or mean or anything, since you did take the time to extract it and make a gist out of it, but you could have kept the formatting.
Q: What's the correct declaration of main()?
A: There are two valid declarations:
int main(void)
int main(int argc, char **argv)
Yet, Knuth states: main()
This feels like Knuth has done a Chuck Norris on C.However, C99 section 6.9.1 "Function definitions" asserts that
int f(void) { /* ... */ }
is equivalent to int f() { /* ... */ }
Note that this is not true of a function declaration since int f();
means function accepting unspecified arguments.