Series of small programming puzzles.
To run the command:
$ ruby xxxx.rb
For some puzzles, you can pass parameter "2" to run the second part of the puzzle:
$ ruby xxxx.rb 2
I was always wondering:
- Should I write a minimum line of codes (at a cost to lose readability)?
- Should I trust the input? For example, will the input file contains only "<>^v"?
- Should I create functions or objects? Will the code be used another time?