It was a while back and I wanted to come up with programming exercises for ruby.
This time, it’s Erlang.
I dug up the code I had done then. I felt that I would need this for future reference. Here’s what I coded to learn Ruby:
- anagram/permutations (list/string – difference?)
- tower of hanoi
- reverse polish notation calculator
- n choose k
- threads: print “red” / print “blue”
- threads: multiple dns lookups
- letter histogram
- interactive Celsius/Fahrenheit converter
- roman/arabic numbers converter
To this, I want to add:
- streams? (next business day? next Monday the 17th?)
- subsets of a list
- standard deviation
The advantage of always coding the same algorithm, especially when learning, is that it becomes less about the logic itself, which you presumably already worked out, and more about the language.
It’d be interested to find out what other people are using.
That’s a great way to learn.
Then, it’s even better to find the most succinct way of expressing the logic while still maintaining readability in your language of choice.
That’s true.
I don’t believe you’re done coding just because it works. I always do an analysis of the code and look for things I’m not completely happy with. That’s usually a sign of sloppy programming or the lack of understanding of the algorithm.
This is all especially true in the case of these exercises. The point is not to solve, say, Tower of Hanoi for the nth time.
For Erlang, Tower of Hanoi taught me about getting command-line arguments, making strings out of various other data (for output), about the different between strings and lists, and so on. When it takes 2-3 hours to get it the way I want, but that the logic was taken care of in 2-3 _minutes_, there is a lot of learning involved.
[...] mentioned before my list of programming exercises I try once I get past the introductions and tutorials. Always working on the same problems really [...]
[...] started doing my programming exercises and I was very impressed with the performance. A 23 disc tower of Hanoi was taking ~30 seconds in [...]