Archive for November, 2011

Programming Challenges 4 - 6

Tuesday, November 8th, 2011

Following immediately on from the previous challenges, I had hoped to redeem my rather miserable performance on Challenge 3.

LCD Problem Output

Read on to see how I did with Challenges 4 - 6.


Programming Challenges 1 - 3

Tuesday, November 8th, 2011

I downloaded a copy of Skiena and Revilla’s book Programming Challenges from here. I wasn’t hugely taken by the book as it is mostly about coding in C, rather than C++ which I prefer, so I’ve only really skim-read it. However, I did take the time to solve some of the challenges after the first chapter, which was a far more valuable learning experience.

Minesweeper Challenge Output

I decided that as the first few challenges looked fairly straightforward that I would make it my goal to solve each one 100% correctly on the first go. Unlike the Ancient Messages challenge where comprehensive test data was supplied, this time each challenge only came with one or two examples. This means that coming up with a good way to test the program is essential if one wants to pass the judge’s tests first time. In a programming competition failure to pass tests means a time or score penalty. But I’m more concerned with real life where a programming error could mean death, financial loss, or worse, the wrong coloured background on a dialog box!

So, how did I do?


Programming Challenges - Ancient Messages

Monday, November 7th, 2011

Earlier this year I wrote about Project Euler. I’ve kept up my problem solving, with an additional 23 Project Euler problems solved in the four months since I wrote that article. I’ve also tackled some problems from other sources that don’t have restrictions on me writing about them.

Ancient Messages 01 Ancient Messages 02

First up, I had a bash at one of the easier looking problems from this year’s ACM International Collegiate Programming Contest. You can see a description of the problem here on the UVA Online Judging website which provides automatic verification of submitted solutions.

The solver’s task for the problem I chose is to decode some “Ancient Messages”. So, how exactly did I do that?