Boston Key Party: Haymarket write-up

The problem’s introduction reads:

Monty Hall wrote a script of how he was supposed to run one of his game shows for his trusty accounting computer some time ago, but hes not really sure what the punch cards mean any more. I mean, that was a while ago. Only, hes sure his key is hidden somewhere in these punch-cards, if he could figure out how to run them… : 150

and they provide a tarball of PNG files that appear to be punch cards.

First punch card

First punch card

You could translate these manually, but a bunch of people have implemented their own punch card readers, and I found a nice python script that might read the images.  However, it seems to want them in inverted colors (white holes, not dark).  I inverted them with Gimp (color->invert) and then ran the script.  The script seemed to work well, but it missed the first column in my case.  Note that you can use the “-i” and “-d” options to the script to help your debugging efforts.  There’s probably some way to adjust the script to catch the first column, I didn’t bother to look into that.

Running the script across all the cards in numerical order yields this text:

 DENTIFICATION DIVISION. PROGRAM-ID. LETS-MAKE-A-DEAL. AUT HOR   MONTE HALPARIN.
ATA DIVISION. WORKING-STORAGE SECTION.  01   DOORCHOICES.     02  GOODDOOR
PIC 9.    02  FIRSTCHOICE       PIC 9.    02  OPENDOOR         PIC 9.    02  C
NGEDOOR        PIC 9.  01 CURRENTDATE.    02  CURRENTYEAR      PIC 9(4).      0
CURRENTMONTH    PIC 99.    02  CURRENTDAY      PIC 99.   01   DAYOFYEAR.    02
CURRENTMONTH FILLER          PIC 9(4).    02  YEARDAY            PIC 9(3).  01
URRENTTIME.    02  CURRENTHOUR     PIC 99.        02  CUR RENTMINUTE   PIC 99.
02  CURRENTTENS     PIC 9.      02  CURRENTONES     PIC  9.    02  FILLER
PIC 99.  PROCEDURE DIVISION. DISPLAY 'MH: WELCOME TO L ETS MAKE A   DEAL'. D
PLAY 'MH: THERE ARE THREE DOORS. ONLY ONE WITH THE   KEY' . ACCEPT CURRENTTIME
OM TIME. IF CURRENTONES < 4    SET   GOODDOOR TO 1 ELSE     IF CURRENTONES < 7
SET GOODDOOR TO   2    ELSE       SET GOODDOOR TO 3     END-IF END-IF DISPL
'MH:   YOU MAY ONLY OPEN ONE DOOR. WHICH DOOR?'. IF CURR ENTTENS = 0   OR CURR
TTENS = 3    SET FIRSTCHOICE TO 1. IF CURRENTTENS =   1 O R CURRENTTENS = 4
T FIRSTCHOICE TO 2. IF CURRENTTENS   = 2 OR CURRENTTENS =  5    SET FIRSTCHOICE
O 3. DISPLAY   'PLAYER: I PICK DOOR ' FIRSTCHOICE '.' IF  FIRSTCHOICE =   GOODD
R    DISPLAY 'MH: THAT IS AN INTERESTING CHOICE OF   DOOR .'    IF CURRENTTENS
R 0 OR CURRENTTENS = 4       SET   OPENDOOR TO 3    END-I F    IF CURRENTTENS =
OR CURRENTTENS   = 5       SET OPENDOOR TO 1    END-IF     IF CURRENTTENS = 2
OR   CURRENTTENS = 3       SET OPENDOOR TO 2    END-IF     DISPLAY   'MH: LET
GIVE YOU A HINT.'    DISPLAY 'MONTY HALL OPENS   DOOR '  OPENDOOR    DISPLAY '
GOAT RUSHES OUT WITH NO KEY.'      DISPLAY 'MH: WOULD YOU  LIKE TO CHANGE YOUR
GOOR CHOICE?'      DISPLAY 'PLAYER: YES! MY LOGIC MINOR I N COLLEGE HAS A USE!'
GOOR     IF CURRENTTENS = 2 OR CURRENTTENS = 4       SET  CHANGEDOOR   TO 1
D-IF    IF CURRENTTENS = 0 OR CURRENTTENS = 5         SET  CHANGEDOOR TO 2    E
-IF    IF CURRENTTENS = 1 OR   CURRENTTENS = 3       SET  CHANGEDOOR TO 3    EN
IF    DISPLAY   'PLAYER: I WILL CHOOSE DOOR ' CHANGEDOOR  ' INSTEAD!' ELSE
ET CHANGEDOOR TO FIRSTCHOICE. IF CHANGEDOOR = GOODDOOR       DISPLAY 'MH: CONGR
ETULATIONS! YOU FOUND A KEY.'    DISPLAY   'MH: THE KEY I S:'    DISPLAY 'KEY
ETALEXTREBEKISASOCIALENGINEER)' ELSE    DISPLAY 'MONTY HA LL   OPENS THE DOOR.
GOAT JUMPS OUT.'    DISPLAY 'MH: THIS IS   THE INCORRECT  DOOR.'    DISPLAY 'TH
 GOAT EATS YOUR PUNCH   CARDS. START OVER.'. STOP RUN.

That’s (broken) Cobol, yuck, but it looks like we got most of the content.  All that remains is to find the key and fill in any missing details.  If you read through the code, you’ll see line 29/30 talks about the key.  Looks like “KEY   ETALEXTREBEKISASOCIALENGINEER)” but its missing the first character of one of the lines.  No worries, you can fill it in manually using a conversion chart.

My by-hand conversion of those two cards has the key as “(SETALEXTREBEKISASOCIALENGINEER)” but that doesn’t seem to work as an answer.  

Chris tried ALEXTREBEKISASOCIALENGINEER, which is indeed the key.

This started a trend of me almost finishing problems and other people figuring out what the correct key for the problem was.

That’s why you work in a team, right?

Leave a Reply

Your email address will not be published. Required fields are marked *