Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2000:
[Freeciv-Dev] A Java Freeciv Score log reader
Home

[Freeciv-Dev] A Java Freeciv Score log reader

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Freeciv-Dev" <freeciv-dev@xxxxxxxxxxx>
Cc: "Rf13@Irz301. Inf. Tu-Dresden. De" <rf13@xxxxxxxxxxxxxxxxxxxxxxxx>
Subject: [Freeciv-Dev] A Java Freeciv Score log reader
From: "Wong TM (Huang Deming)" <lookmeow@xxxxxxxxxxxx>
Date: Sat, 29 Jul 2000 17:53:49 +0800

This program should be able to display your Freeciv ScoreLog File in
histogram. I used Forte(TM) For Java(TM), Community Edition, 1.0 to program
it, this is mine first Java application. I have attach a zip of the source
code, run javac *.java to compile it.

Here a interesting formula that calculate the number of turns between any
two freeciv year. Somehow I had to add a 1 to this formula to be more
accurate.

    currentTurnRange = Math.abs ((Math.min (Math.max
(startYear, -4000), -999)
                        - Math.min (Math.max (endYear, -4000), -999)) / 50);
    currentTurnRange += Math.abs ((Math.min (Math.max
(startYear, -1000), -1)
                        - Math.min (Math.max (endYear, -1000), -1))  / 25);
    currentTurnRange += Math.abs ((Math.min (Math.max (startYear, 0), 999)
                        - Math.min (Math.max (endYear, 0), 999))     / 20);
    currentTurnRange += Math.abs ((Math.min (Math.max (startYear, 1000),
1499)
                        - Math.min (Math.max (endYear, 1000), 1499)) / 10);
    currentTurnRange += Math.abs ((Math.min (Math.max (startYear, 1500),
1749)
                        - Math.min (Math.max (endYear, 1500), 1749)) / 5);
    currentTurnRange += Math.abs ((Math.min (Math.max (startYear, 1750),
1899)
                        - Math.min (Math.max (endYear, 1750), 1899)) / 2);
    currentTurnRange += Math.abs ((Math.max (startYear, 1900) - Math.max
(endYear, 1900)) / 1);

Credits
=======
Raimar Falke <rf13@xxxxxxxxxxxxxxxxxxxxxxxx> For solving mine worst headache
in designing a
class holding the main CivLog data structure. You been a great help.

       __
.----.|__|.---.-..-----.
|  __||  ||  _  ||  _  |
|____||__||___._||_____|

Attachment: civlog-0.01lite.zip
Description: Zip compressed data


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] A Java Freeciv Score log reader, Wong TM (Huang Deming) <=