In a recent post, I talked about CodinGame, a website full of programming challenges, games, and AI puzzles. Well, this past week, they also ran a week long, competitive programming challenge called Smash the Code. Apparently they hold these periodically and some companies use them as recruiting opportunities, sort of like a more fun version of a technical coding interview problem.
Since I've been enjoying myself so much wiriting code to solve the games and puzzles, I figured I'd give the contest a shot to see how I do. The contest was essentially a week long hackathon to write AI code to control one side of a 2 player Tetris style game. The rules got more complex as you progressed through different tiers, but the basics were that you tried to clear rows on your side and pile up rows on your opponents and whoever scored more points or stayed alive the longest won.
Once you were happy with your code, you could choose to submit it against the other players in your current tier, at which point they ran 100's of simulations to determine your respective Elo rating. If you ranked higher than that tier's baseline "boss" you leveled up to the next tier, and if not, it was back to the drawing board.
I'm happy to say that, even though I don't have any formal game training, my programming skills were enough for me to earn my way to a finish in the top 20% overall and 22nd in the country. This was despite choosing to program in JavaScript, when the main program involved a lot of breadth and depth simulations and had a 100 ms time limit per round. Not surprisingly, many of the top finishers used the more efficient choices of C++, C#, Java, etc. while the top JavaScript finisher was 61st.
Even though my program was only able to simulate about 4 rounds ahead, I was pretty happy with the solution I came up with for my first contest. It ended up being flexible and able to be tuned with different weighting parameters that allowed me to tweak the behavior and helped me make a last minute push up the rankings. Not bad for the first time, but I'm already thinking of ways to improve for next time...
No comments:
Post a Comment