3 ms·
Sudoku solvers are near and dear to my heart. They’re my go to problem when learning a new programming language because they’re just complex enough to exercise
by yeldarb 7y ago
Sudoku solvers are near and dear to my heart.
They’re my go to problem when learning a new programming language because they’re just complex enough to exercise a whole bunch of different language features.
I built this when I wanted to learn Swift and dip my toe into machine learning: https://twitter.com/braddwyer/status/910030265006923776?s=21 https://twitter.com/braddwyer/status/910030265006923776?s=21
- pj_mukh 7y agoThat’s a really great way to learn a new language. Maybe take a Swift 101 course and then drag through a sudoku solver. Very cool!
- ashtonbaker 7y agoI do the same thing! The first program I ever wrote was a very simple sudoku solver on a TI-84 calculator (it performed the constraint propagation logic that Norvig describes), and for every programming language I have learned since I have re-written that code.
- opnitro 7y agoFor me, my go to problem tends to be a simplistic lisp interpreter.
- jsjohnst 7y agoI’ve always used an authoritative DNS server as my go to. Almost all code I write has to do some kind of network IO, so learning the nuances of how TCP and UDP sockets work is important to me. It also happens to touch on bitwise operations, data structures, and parsing, so it’s a great project to quickly become competent in a language (assuming you already know DNS well at a protocol layer).
- opnitro 7y agoThat's a great one! I might steal it.
- kregasaurusrex 7y agoThe first one I'd seen was implemented in a Ruby book, and I agree it's a good yet moderately challenging problem to do. Once you're done solving the base case, making improvements like implementing a more efficient backtracking algorithm or drawing a board within a GUI can be added as well. Edit: The book was 'The Ruby Programming Language' by O'Reilly Publishing, not 'Programming Python' as I originally thought, also published by O'Reilly.
- rude_dude 7y agoSeems this is a common theme... I wrote a (no search) solver in Perl for a class a while back. Mostly wanted to see how far my own solution finding rules would get me without having to follow through on solving hundreds of puzzles myself.
- glenvdb 7y agoI know someone who likes to create a fractal generator when learning a new language. He says it gives you a bit of exposure to the strengths of quirks in the language from implementing algorithms, working with data structures, and displaying a GUI to render an image to screen.
- sdenton4 7y agoMy go-to is the first fifty problems on Project Euler. It ramps up quite nicely from "can you write a for loop?" to problems with some nice complexity. Great for learning a language!