Installation
How to install a Masters of Java environment.
The preparation procedure of a Masters of Java environment consists of the following steps :
- Installing the J2SDK 1.5.0
- Downloading Masters of Java
- Verifying the installation
- Creating players
- Playing a competition with multiple rounds
Installing the J2SDK 1.5.0
Go to the Sun website and download the J2SDK 1.5.0. Install the J2SDK as you like, but make sure that you properly set the JAVA_HOME and PATH environment variables. You can do this on windows using Start->Settings->ControlPanel->System->Advanced->Environment Variables. The JAVA_HOME should point to the installation directory (typically something like c:\j2sdk1.5.0_09) and the path should have an entry pointing to its bin directory. Test the installation by opening a command prompt and checking the version :
C:\> java -version java version "1.5.0_09" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03) Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode, sharing)
Downloading Masters of Java 1.2
This is easy :-) Just go to the MoJ download page and download the zip file.
Unzip the file in some appropriate directory and have a look at the created directory structure. There is Client for the client, Server for the server and the assignments and ofcourse a source directory.
Verifying the installation
Open a command prompt and goto the server directory.
Execute the start-case-local.bat with the name of the assignment of your choice. Example: start-case-local hanoiCase.jar
There should be no stacktraces and a screen containing a clock should appear. If it does not, double check your JAVA_HOME variable and see if the tools.jar is present in the %JAVA_HOME%/lib/ directory.
In the client directory, double click on client.jar or use client.bat
A client with a login screen should appear. Login using 'NLJUG' as username and 'Welkom' as password. Note the password is case sensitive. You should now enter the wait screen.
Goto the clock and press the space bar. The clock starts and the wait screen has dissapeared to make room for the description, testset and code.
Try to finish the assignment before the clock runs out :-)
Creating Players
Use the usereditor.bat in the server directory to do this. It will popup a rudimentary GUI where you can edit the ./data/team.properties file which contains all the teams. Note when you enter the passwords they are not encoded. Even if you save they remain readable. However, before you can use a password to login into the engine they need to be encoded, so when you're done with adding teams check the encode passwords checkbox and then Save. Now the team.properties file can be used by the MoJ engine.
An interesting new option is the ability to specify one assignment that must be skipped by the team (we used this in MoJ2005 to allow more players). The scoreboard takes this into account.
Playing a competition with multiple rounds
This is basically the same as described in 'verifying the installation' only the process is repeated a number of times. All progress is recorded in the state.csv file. Before you start the competition you should delete this file.
Also note the difference between starting an assignment (all workspaces are recreated, any data in there is lost) and resuming an assignment (workspaces are left untouched). The engine uses the state.csv file to determine if a round has already been started.
Finally there is the scoreboard.bat which reads both the team.properties and state.csv and renders a nice scoreboard of this. On the console more details are printed. If there are skipped assignments present in the team.properties the scoreboard will use the 2005 rules which are as follows: the fastest team scores 20 points, the second fastest 18, and then 16, 14, 12 and 10 points. Teams that come after that score 1 point. Any incorrect solutions or not submitting a solution at all scores 0 points.
If No skipped assignments are present the scoreboard uses the 2006 rules which are 400 + the number of seconds you've left. Easier, better and more explainable.
If you don't like the duke scoreboard there are several other implementations. Have a peek in the source code.