Perl Weekly Challenge: A Man, A Plan, A Canal… PANAMA!

So, when someone mentions palindromes, my mind immediately jumps to my favorite book on mathematics, algorithms, music, art, and philosophy: Gödel, Escher, Bach by Douglas Hofstadter. This was the book that introduced me to the idea of a musical palindrome, a piece of music that sounds the same played forwards and backwards, and the author cites J.S. Bach’s Crab Canon as an example.

So let’s approach Perl Weekly Challenge 288 from both sides… (no, no, I will not change the theme to Joni’s Clouds).

Continue reading

Perl Weekly Challenge: Exact Change Only!

Nothing jumped out at me for the theme this week, so I started free-associating. The first task, “No Connection”, makes me think of bus routes, and that’s reinforced by the second task, “Making Change”. But I’ve already used The Hollies Bus Stop, so I started thinking about busses, and how they keep getting stuck in traffic, and I landed on Jimi Hendrix’s Crosstown Traffic.

So, with the musical background set, let’s not slow down and get to the other side of Perl Weekly Challenge 285.

Continue reading

Perl Weekly Challenge: Relatively Lucky

This week I’m having trouble locking in on a musical theme. With the tasks being “Lucky Integer” and “Relative Sort”, nothing really jumps out at me. I finally decided that “Lucky” was the key, and that made me think of Emerson, Lake, and Palmer’s Lucky Man.

Now that we have our musical accompaniment, we can work on Perl Weekly Challenge 284!

Continue reading

Perl Weekly Challenge: Bag! Bag! Bag!

“Bag!” “Bag?”
“Bag! Bag!” “What do you mean, bag, bag?”
“Bag! Bag! Bag!” “What bag?”
“No bag!” “No bag?”
“Your bag! Suddenly! Here! Now—gone!”

When I saw the tasks for this week, my programming brain immediately screamed “Bag!” (it’s becoming my favorite class for PWC problems) and the moment that happened, my theater brain immediately went to Vicky and Roger in Noises Off. My wife, however, pointed out that Noises Off isn’t a musical, so she suggested this week’s musical theme, Papa’s Got a Brand New Bag. James Brown is certainly appropriate accompaniment to Perl Weekly Challenge 283

Continue reading

Perl Weekly Challenge: Appear Twice, Count Once

There’s no relation to the problems for this week’s musical theme. Earlier this week, my wife and I watched the documentary Gordon Lightfoot: If You Could Read My Mind, so you’re getting my favorite Gordon Lightfoot song… Canadian Railroad Trilogy.

So now, while we’re listening to the construction of the Canadian Pacific Railway, let’s construct some code as part of Perl Weekly Challenge 280!

Continue reading