I have started learning RUBY programming language and I bought a book “The Ruby Programming Language ” written by David Flanagan and Yukihiro Matsumoto (Developer of Ruby programming Language and fondly called MATZ ) .
In the first chapter there is a “Sudoku solver” written by MATZ and it is one of the most Beautiful Code I have ever seen . The Sudoku program is the most Beautiful Code because it is documented very beautifully and you can understand the code with the help of documentation , if you have read all the topics preceding Sudoku program in the first chapter ; other beautiful thing about the code is the intelligence with which Matz solves the problem and finds out all unknown values in the Sudoku puzzle . The use of iterators has also been done very cleverly and since Iterators were new to me so I enjoyed learning them from code written by Matz.
The code by MATZ helps to learn intelligent programming and brings us face to face with the simple yet powerful Ruby programming language and for an amature programmer like me it was a great learning experience!!!
You can download the Sudoku program and also some other examples present in the book from O’Reilly site whose link is http://examples.oreilly.com/9780596516178/
The details and reviews regarding the book are at http://oreilly.com/catalog/9780596516178/