We started off with the first exercise by monkey patching the Array class to include our own implementation of Array#uniq. Two exercises into the day, we were faced with implementing our own Tower of Hanoi game in the command line. We went the object oriented route, creating Rod and Disc classes, and separating out the game logic. We ended up spending a majority of the morning getting it playable. You can check out the source here on github.
We wrote a little stockpicker function, which took a history of stock prices by day, and told you on which days to buy and sell for maximum profit in the given range. And later we implemented the Caesar cipher using ASCII codes. The Caesar cipher, is a simple offset cipher. For example in a Caesar cipher which offsets by two: a => c, b => d, ... x => z, y => a, z => b. So 'hello' => 'jgnnq'. Luckily, String#each_byte and Fixnum#chr came in handy when going from some character to the ASCII code and back. The only catch was dealing with characters that were offset past 'z', in which case we'd have to take the overflow and start back at 'a'.
After implementing our own Set class using the functionality of Hash, we spent a majority of the afternoon working on learn_ruby's exercise 15 "in_words". The exercise monkeypatches Fixnum to include Fixnum#in_words, a method takes a number under one-quadrillion and converts it into a string representation. For example 1000013.in_words should return "one million thirteen" (I know, I know, it should be "one-million thirteen", but that wasn't in the spec).
The exceptions in converting numbers to words were killer. We ended up taking blocks of three numbers at a time, converting the block to words, and then optionally tacking on a suffix like "million", depending on where the block occurred on the input number.
While it was a little bit messy, we ended up getting it to pass the test. I'd like to come through and refactor this code if I ever get the chance. But that's for another day.
We ended our first day by starting work on a maze solver. But sadly we weren't able to finish. Some other time perhaps.