Wednesday, August 29, 2007

05. CodeRuler

Group members: Michal Zielinski & Chiao-Fen Zielinski-Liu

Source Code: Please click here to download

We have chosen a special strategy for our knights and peasants to follow. Fist of all the peasants are instructed to walk in certain directions as a group. This means that all peasants, rather than wondering randomly around, follow a path in any direction for a specific number of turns which makes them all walk towards one direction for a certain timespan, therefore occupying more and more land.

In the meantime the knights are instructed to find out the location of the enemy peasants and capture them as they are discovered. The knights also have a second task that is to capture any enemy object that is in the location of one square in either direction.

As this battle of occupying land and capturing peasants goes on and we inherit more and more land, we also produce more peasants as well as knights. Although, the code is written such that if our ruler has less knights then peasants, we try to create more knights.

This are the result runs:


Result 1Result 2Result 3
michalz-chiaofen vs. migrate ruler524 - 135481 - 32441 - 73
michalz-chiaofen vs. gang up ruler198 - 220512 - 302225 - 189
michalz-chiaofen vs. split up ruler189 - 221147 - 178114 - 152


Finally, the chosen strategy works well against the migrate ruler and the gang up ruler but it did not help winning against the split up ruler.

Writing this game application I used the chance to learn the eclipse platform as well as to brush up my Java programming knowledge. I have not used Java for a wile but it took not long to remember and realize all the functionalities that Java provides and which I have learned in previous classes. With the eclipse software I did not have many problems yet. However, we had to look up how to run javadoc over our files. With a little of searching on the net everything became clear and we were able to generate the needed HTML doc pages. In addition, we had some trouble with the CodeRuler game itself, when downloading it. After successful downloading of the CodeRuler zip file and proper extraction of them into the right folders, first we weren't able to see the other folder under New -> Project... . However after activating the Java Runtime environment the folder magically appeared.
Our teamwork was well. It was fun not to have to come up with a well organized strategy all by yourself. After, we plan out our strategy we thought about how to start writing the code and I must confess that if two people think about the code, it is generated much faster with even fewer bugs because the other person who is not writing code at that time has the chance to look for potential bugs. Therefore, I support teamwork at all times.

No comments: