Crestron Masters Hackathon 2024

Jeremy Weatherford
5 min readMar 21, 2024

That’s right, it’s time for my annual Hackathon post-mortem! And in fact, this is my final post as a Hackathon contestant… but more on that later.

I knew nothing going into the Hackathon this year except that we didn’t have to register teams this time. When they first opened the room to the participants, I saw several items that I was NOT looking forward to: a dartboard, a Nerf shooting gallery, several Rubik’s Cubes, a putting green, ring toss, and a contraption that looked like a medieval torture device with a twisted copper tube and a giant wrench.

I tried to stay optimistic, though, and it turned out we started with trivia questions, pub-style. Most of them were multiple choice, and there was a good variety of Crestron history, computer history, and SIMPL and C# programming puzzlers. I fought Justin Rickard for the top spot through most of the round, and managed to clinch the win by a narrow margin over Josh Lanza. On to phase 2…

At this point the field was whittled down to the top 16 participants based on trivia scores, and we were (randomly?) assigned into four teams of four. With me I had Josh Lanza (second place in trivia!), David Ives, and the alphabetically advantaged Alex Adach. Next, a scoreboard popped up on the screen with 8 challenges for each team, and my heart sank as I realized that none of them had anything to do with programming. Oh well, I thought, it was fun while it lasted.

Then Toine handed out a problem description to each team, and I was thrilled to see that some programming was involved after all (really, could it be a hackathon otherwise?) In addition to the 8 challenges, we were also being asked to implement a Tic-Tac-Toe game that could communicate with a server and allow a user to interactively play against a computer. There was some documentation of the weird JSON-over-TCP protocol, but it was missing some important parts like how to compute the required checksum field.

As it turned out, we would have to earn “hints” by completing the challenges, although it would be more accurate to say that those hints were required parts of the problem description, such as how to connect to the game server!

I got started on programming a quick user interface while the other three members of my team took on the challenges. My usual go-to hackathon language is node.js, but I didn’t have a great way to make a user interface, and I figured building a command line or web interface would take too long, so I fired up a C# project to make a Windows app. 9 buttons in a grid plus a “New Game” button, and the GUI was done. I knew the code would need to send and receive JSON over a TCP connection, but I had no idea what would come back from the server. I coded what I knew and tested it against a local TCP server to make sure my formatting matched the document, then I started in on the challenges.

My first stop was the torture device, which turned out to be an “Operation” style test of steady hands — move the pipe wrench along the length of the twisted tube without touching it. I made it a paltry 25% before getting “buzzed,” then moved on. The shooting gallery was already complete, and I didn’t think I could solve a Rubik’s Cube without printed instructions, so I lined up for the putting challenge — just in time for my teammate to complete it. Now with four games complete, we were able to get our first hint: how to connect to the game server! Back to my laptop only to discover that the game server wasn’t accepting connections.

I double-checked everything on my end, checked from a teammate’s laptop, and even asked Chris Waldron (network guru) to check the port — nobody could connect to it, so at least it wasn’t my problem to solve. Back to my desk while they worked on it, and I decided my efforts could best be used on the only non-physical challenge: getting a certain score playing the Snake game. It took several frustrating minutes to get in the groove, and the loud cheering and louder buzzers from the torture device didn’t help much, but I eventually racked up the required number of points and took a screenshot for proof. So, that was my contribution to the 8 challenges — the only non-physical one.

Sometime around this point we got an announcement that the ports were finally open on the game server, so I was able to connect and send a “New Game” message. After fixing a couple of quick bugs, I got a game state message back from the server and could start parsing it to determine whether the human user was playing as X or O, and what was currently on the board. My first attempt at displaying the board failed badly, showing that the computer had placed four “O” tokens at once for its opening move, so I had a few more bugs to track down.

About the time that was done my teammates completed enough challenges to receive the second “hint” which was how to compute the required checksum to send with player moves. I coded it up, tried it out, and was able to place a piece in the upper left corner of the board… and nowhere else. Everything else gave an Invalid Checksum error. Back to the description of the checksum, and everything looked good. I checked several positions by hand, but the server didn’t agree with me. I asked Chris Tatton (game master) to take a look at it, and he realized that we didn’t have the complete checksum calculation on our hint. After adding the second part of it, we were able to place pieces and complete a game!

I called Chris over to show him, and he immediately broke my game by playing an O over top of an X. Rather smugly, he pointed out the part in the problem description that says that my code has to prevent invalid moves. That took a few minutes to add, and I also prevented moves while the game was over just in case he checked that as well. One more verification run and our win was official! Thanks to my awesome teammates, as well as to Chris Tatton, Toine, Selveno, Chris Waldron, and everyone else who contributed to running the hackathon.

Now for the bad news — I will not be participating in future Hackathon contests. Rich Sasson told me in advance that I had hit the maximum number of wins, and that if I won again I would be promoted to the team in charge of developing and running the Hackathon. I’m actually very excited about that, and I think it’s a great way to cap off my Hackathon run: 2018 Battleship, 2019 Escape, 2023 Minesweeper, and now 2024 Tic-Tac-Toe. I’m looking forward to coming up with fun and diabolical challenges for the participants in future Hackathons!

Group photo with Andrew the Alligator (Orlando Masters mascot)

--

--