Twenty-one

The last exercise in the Programming Foundations course at Launch School was coding Twenty-one, a game similar to Blackjack. I’m still feeling my way through Ruby and spent most of my time looking up constructs that would be efficient. The Zen of Python states:

There should be one — and preferably only one — obvious way to do it.

Ruby seems to be the opposite. From my brief acquaintance with Ruby it appears that there are often multiple, equally efficient ways to do the same thing. So, for this exercise, as much as I could, I did my own coding first. If it looked like the proffered example, I tried to rewrite my code in a different way.

I’m still spending more time than I should futzing with exiting loops with breaks.