Friday, August 31, 2007

CodeRulerReview


I was assigned to review Sonwright Gomex’s code. The code is well-organized and do not contain a lot of violations against the Java standard. It was commented well and was easy for me to follow along. I liked his strategy and he did a good job with the knights. All in all, this is a nicely written code and I had a good time reviewing it.

































File Lines Violation Comments
MyRuler.java 10,11,185,* EJS-6 Comment line has more than 100 characters
MyRuler.java12,17,25,* ICS-SE-Java-6 Comments hsould always end with a period
MyRuler.java16,17,18,* ICS-SE-Eclipse-2 Code should be indented 2 spaces instead of 4
MyRuler.java16,172 EJS-5 The "else-if" should start on a new line
MyRuler.java193,201,210,* EJS-76 The "if" or "else" should always has curly braces

Wednesday, August 29, 2007

Code Ruler Experience

Group members: Marcius Bagwan, Ka Yee Leung

Source code: http://www2.hawaii.edu/~kyleung/kyleung-marcius.zip


Results:
kyleung-marcius vs split-up: 631:201 480:327 792:224
kyleung-marcius vs migrate: 880:0 774:7 823:0
kyleung-marcius vs gang-up: 70:521 596:340 713: 178


Strategy:
Castle – It would alternate between generating a knight and a peasant. When the number of knights runs low, it will generate knights continuously.

Knights – They are split into two groups. One group is specialized in attacking the knights while another is specialized in taking over castles. Once all castles has been taken over, both groups would attack knights together. If all enemy knights are gone, they would then aim at the peasants.

Peasants – They would only move to land that are unclaimed or claimed by the enemies unless no such land are available.

Lesson learned:
Eclipse: I get much more familiar with Eclipse after working on this project. I am more similar with the debugging and how to utilize the different functions provided. I can’t imagine switching back to emacs to type up my program again where I could end up getting twenty error messages just because of a missing semi-colon.

CodeRuler: This is the best programming assignment I have ever done. It was a lot of fun and was very effective in giving us a chance to practice with our java skill. It makes me realize how much Java can do and also, how much java I don’t know. CodeRuler is really a great and fun Java learning project.

Working with another person: I am so grateful to have such a great partner, Marcius for this project. He is patient and helped me a lot. From him, I learned how to cooperate with others so that the whole group can work together and learn together.

Sunday, August 26, 2007

02.OSS.Experience



The software I downloaded is Risk. It is the java version of the classic strategic board game. The goal of the game is to control all the territories by taking over territories from other players. This game employs a simple map format, supports 1 to multiple players, allows network play and works in all Operating Systems that have java 1.4 or higher.

It fulfills the first Prime Directive by providing every features you can find in a typical Risk board game. Moreover, while you need at least two players to start the board game, this java version allows the user to play against the computer so that anyone can literally play Risk anytime alone. Also, there is the convenient Save and Load function so that users can save their unfinished game and play again at another time. However, it can improve on the Save function as it takes a long time to save a game. Other than that, it has done a great job in fulfilling the first Prime Directive.

The second Prime Directive is satisfied to some extent. For experienced users, the installation would be easy for them as it only requires the usual downloading procedure: download the zip file, unzip it and run the program. However, for new users, they may find themselves at a lack of help as the readme file is not very useful without much information on installation. Upon unzipping the file, new users would likely to be lost in the long list of files to find the executable Jar file. This problem could have been improved by renaming the executable file as “run”.

Finally, for the third Prime Directive, it is also partially satisfied. A zip file of the source codes comes along with the download package so anyone can access and modify them. However, not all files contain detailed documentation which makes it difficult to follow the code. I can imagine it would take me some time to understand and eventually modify the code.

All in all, this game is well-written with a user-friendly interface. I enjoyed the game! I trust anyone should catch on to the game easily and have fun with it! Below are some screenshots from Risk:

the map


Roll the dice to determine whether an attack is successful

Tuesday, August 21, 2007

FizzBuzz



It took me 12 minutes to complete this program as I haven't used Eclipse for a long while and it took me some time to pick up on how to create new project and classes.

The biggest problem that I encountered is the Java language itself. I have not programmed in Java for a while too and I am not surprised that I have mixed up Java and C languages' syntax completely. I ended up writing a logically correct but grammatically disastrous program. In this sense, Eclipse is very handy as it points out all the syntax mistakes I made and so I don't have to waste time to read through every line to find the bugs.

From this experience, I learn that I shouldn't take any task lightly. Every program, no matter how unimportant and easy it may seem, should have been taken seriously. This is because in software engineering, every component has to be correct in order to produce a perfect software and a mistake in a small program can lead to serious bug in other programs. Also, I learn that I should familiarize myself with Eclipse and other programming software as it is impossible for a software engineer to take care of every little detail of a program and a good programming software would help a lot in this area.