Wellington
Perl Mongers

Table of contents

Kiwi Pycon 2014 Codewars

On September 12th the Wellington Perl Mongers HackOff formula was successfully transplanted into the Python community as part of the Kiwi Pycon conference in Wellington, New Zealand. Much fun was had on the night, but even if you missed the event, you can still join in the fun by solving the problems listed below.

What was it all about?

From the original announcement ...

This year's Codewars event will feature a revised format with the goal of getting more people involved.

Codewars will still be a team event, but this year we're inviting EVERYONE to join in. We'll help people assemble into teams on the night and hope that some of you will use this as an opportunity to meet new people.

This year's event will feature a series of problems for all teams rather than the knock-out style of competition from previous years. That means if another team beats you in the first question, you stay in the game and may catch and pass them on later questions.

The incurably competitive will race to complete the greatest number of problems in the shortest time. Others will take things at a more sedate pace and enjoy the challenge of pitting their wits against the warped and twisted Codewars-master.

Most of the problems will require you to write a program to find the solution. You may use any language you like to get the job done, although it seems likely Python will be popular.

Whilst not actively discouraging the competitive angle, we were aiming to optimise more for fun and participation - that was mostly successful.

How did it work?

We ended up with nine teams on the night. Each team comprised 3-5 people, with one or more laptops connected over wireless to the competition web server.

Once the teams were all logged in to the web server, the first problem was made available. The teams downloaded a data file from the server and set to work 'decoding' (and I use that term very loosely) the file to reveal a 'token'. Here's an example of a token:

ETGJXSFH

When a team successfully revealed a token, they would type it into the web server, which would validate the token and then make the next problem available. The web application also gave teams the opportunity to show their work - upload program files or shell command histories etc, for later analysis.

It's important to note that although this was billed as a programming competition, there was no requirement that teams use only their own code. All teams had full internet access for using search engines, downloading software packages and submitting files to web services. The only thing that mattered was finding the right answer as quickly as possible.

The teams

Best Cats

Cats

'; DROP TABLE Users; --

Halt and catch on fire

Team Tazzo

BeGaMeDi

Zot43

Gravity Cyborgs

Back of the Bus

Team Food Recovery Option

The results

One team didn't get the memo about optimising for fun and were fully optimised for winning. Team "Cats" deployed Perl with ruthless efficiency and managed to complete all six problems before the official finish time! Unfortunately since they weren't actually registered Kiwi Pycon attendees, we couldn't declare them the official winners.

The official winners were Team "Best Cats" who provided further data to suggest feline references in the team name is a winning formula. They completed the fifth problem shortly after 9pm - as we were packing up.

Three teams completed four problems; two teams completed three problems and "Team Food Recovery Option" who had optimised for food consumption and started nearly two hours late managed a creditable two problems.

This chart shows the number of problems completed by each team over time.

The chart would have been even better if it managed to provide live updates on the night but due to the codemaster's own ineptitude it steadfastly refused to show anything but a pair of axes all evening.

The raw timing data is shown in the table below:

Team Name Problem 1 Problem 2 Problem 3 Problem 4 Problem 5 Problem 6
Cats18:28:5518:45:3018:54:2019:03:4519:27:4519:56:22
Best Cats18:44:0819:02:2819:27:4120:12:0921:01:20 
Halt and catch on fire18:36:1019:14:0019:36:3320:35:31  
Team Tazzo18:56:5119:24:4520:12:1520:41:55  
Back of the Bus19:00:3419:26:0520:17:4920:48:49  
Gravity Cyborgs19:04:1419:39:4120:42:20   
BeGaMeDi19:02:5519:32:4420:46:40   
'; DROP TABLE Users; --18:41:0119:25:52    
Team Food Recovery Option20:13:4720:37:01    

The problems

Even if you missed the event, you can still join in the fun. Listed below are the same six problems that were used on the night. For each problem there is a data file and a 'hint'. The correct solution (token) is also listed but this is largely redundant because in each case it's pretty obvious when you've solved it.

1. Data File There's no substitute for big words
C4TGLEVU
2. Data File It looks like a perfect square
4SEZUZDI
3. Data File Journey to the mooooon
19690720
4. Data File A walk in the woods
BRD6P2WQ
5. Data File Choose your weapon carefully
LUCYTODD
6. Data File From sliderule to spreadsheet [MODIFIED]
B75KTRJ6

Problem 3 even had its own soundtrack.

The solutions

We may or may not post a solutions page, but you probably won't need it anyway.

If you want to publish your own solutions then by all means do so and let us know so we can link to them: