
Imagine Cup
Originally published on my old blog at cumps.be on February 13, 2005.
These posts are written in the past tense because they also go into the report I have to write after my internship. I’m writing them piece by piece, otherwise there’d be too much to remember and a lot less detail :)
For the second year in a row, Microsoft organized the Imagine Cup. This is an international contest with various categories. As a part of my internship, I had to compete in the Visual Gaming and the Information Technology categories.

The IT category was about diving into solving real life IT problems. With questions about networks, databases and various servers the content was really diversified.
You get 30 minutes to solve 30 questions, scoring 3 for each correct answer, 0 for a blank answer and -1 for a wrong answer. The first 5 people of a country advanced to the next round, which was the first goal of my internship.
After having spent half an hour taking the quiz, I had to wait a day to get the results, to prevent abuse. My score ended up being a 66/90, placing me in shared first place in the Belgian competition. My first goal was reached.
The Visual Gaming competition was a coding challenge. In this competition you were given an SDK, which included a 2D-viewer, 3D-viewer, documentation and the required assemblies.
In the VG competition you had to write code for robots in a small game, their brains, also called AI. The main things I learned thanks to this competition were algorithm knowledge, performance issues and logical thinking.
Algorithm knowledge was useful to find optimal actions for the robots, for example, the A* algorithm helped to find the shortest path. Other problems, such as the Traveling Salesman Problem, also had to be solved and implemented to gain a strategic advantage in this game.
Performance was a very important aspect in the VG competition. Because your code had a limited time-window it could run in, it had to be very fast, making sure it stayed inside that window. This was the reason why I implemented a binary heap in the pathfinder, and why I made a lot of performance optimizations, such as preventing boxing and unboxing, storing certain 2-dimensional arrays in a 1-dimensional one and cutting back on object initializations.
But knowing how the algorithms work and how to tweak for performance alone didn’t do the trick. The difficulty lies in making it all work together and operating as a big unit, working its way to a victory. That’s where logical thinking came in, to determine what tactics to use, and which algorithms to use.
After an afternoon of playing with this I managed to get 1325 points, which was enough to get to Round 2, and to achieve another internship goal. My personal next goal was to score as well as possible in the second round.
I wrote about the result after the Visual Gaming finals in Paris.
You May Also Like

A* Algorithm
How the A* pathfinding algorithm works: the open and closed lists and the F, G and H scores, demonstrated on a grid of pixels.

Binary Heaps
Speeding up A* by keeping the open list in a binary heap stored in an array, with add and remove in C# and timings against a sorted ArrayList.

Day One
My first task as a Microsoft intern: managing a meeting of the Microsoft Student Council, and what that council is about.



