For this post, I decided to write about a few fun ways to use puzzles to sharpen your Ruby skills during your free time. (I know “free time” isn’t really much of a thing anymore, but bear with me). As a few of you have surely seen, I’m huge on doing the New York Times crossword puzzle every morning (by doing, I mean attempting if it’s a Thursday or Friday, or just doing this for about 10 minutes if it’s a Saturday:

I think doing puzzles is a great way to take a break from whatever you’re doing (be it an intensive coding bootcamp or otherwise) to give your mind a quick break from its current task while still keeping it occupied and energized. Here are some of the best resources I’ve found (many of which I’m sure will be familiar to a lot of you):

Project Euler

Our very own Mike A told me about this before we even started here. As defined on their website, Project Euler is “a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.” There are currently 558 problems, ranging from “easy” to, uh…I’ll let you have a look for yourself:

Maybe someday. In another life.

Anyway, one interesting thing about Project Euler is each problem is designed so that (given an efficient algorithm) a standard computer can find the solution in less than one minute. You can do the problems in any order, but I’ve been going chronologically, since if you solve the first 25 problems, you move up one level, and if you solve the next 25, you move up another, et cetera. Another great thing I recently realized is that Learn actually has its own Project Euler track!

So you can just switch on over for a quick crack at a problem whenever you want or need it. Also, the Learn track makes you solve the problem two ways: procedurally (just using methods) and using object orientation (using classes with methods). So far, they’ve been pretty similar, but I imagine that distinction between them will decrease as I progress.

I must say, after six weeks, I’m incredibly proud of my staggering success so far, as I’ve solved a staggering…wait for it…

2 PROBLEMS!!

The first two I got through relatively quickly. Here’s a quick peek at the first one:

The problem.
My procedural solution
My object-oriented solution

Unfortunately, I’ve been stuck on the third one for many, many weeks.

I’ve tried many, many different ways of solving this one. The problem is not that my solutions don’t work (I know they do because I’ve tested them on other numbers). The problem is that when my algorithm is run on that giant number, it takes much more than a minute for my computer to solve it. How much more? I never get to find out since running it has caused my computer to crash without fail each time. I’m determined to come up with something more efficient without resorting to just looking up the solution, so if anyone wants to work together on it, please let me know!

That frustration aside, Project Euler seems to be a really cool, fun way to sharpen your Ruby and problem-solving skills. I recommend it.

Rubeque

This one offers 102 puzzles that are less math-oriented and more directly Ruby-oriented. One nice thing about it is that the problems they start you off on are ACTUALLY easy, so it’s a nice little ego boost being able to breeze through the first handful of problems. Here’s a look at one of the first ones:

And a peek at the last one:

I haven’t made too much progress on here yet, since I just discovered it while researching this blog, but I’m excited to work on it some more this weekend. This website also has links to a bunch of other, similar websites you can check out if you end up finishing these or getting impossibly stuck on one of them (as I’m sure I will).

Non-Coding-Related Ones!

Other times, you may just want a quick break from programming altogether. That doesn’t mean you should stop exercising that part of your brain during your break! As I said above, I am a huge proponent of the Times crossword puzzle. Contrary to popular belief, it’s less about the amount of trivia you know (though that obviously helps), and more about the same sort of problem-solving, logic-based skills that we employ in our work here every day. Learning to do the Times puzzle is just like learning a programming language — intimidating at first, invigorating and fulfilling once you get the hang of it. Not to mention, there are a few Times puzzles that are among the funniest and wittiest things I’ve ever experienced. Here’s a quick glimpse at one of my all-time favorites (apt given a new president is fast approaching) :


Also, straight up logic puzzles are an even better way to just directly test that part of your brain. Just a grid, a list of hints, and your brain.

Again, not directly related, but a great way to give yourself a break from coding while still keeping that part of your brain going.

While I don’t want to be responsible for an increase in procrastination among the class, I do think a lot of these are great ways to take productive breaks from the barrage of labs we’re constantly facing. I hope they’ve given you some of you inspiration for a change of pace when you take your next break!