Make your own free website on Tripod.com

Nedstat Basic - Free web site statistics    webmaster

Game database in Java

Norsk versjon

I am saving money for a dictionary so read this with an open mind.

This program (applet) could be used on browser as suport Java 1.1

Licensing:
If you make a new language file I would like it if you send it to me. I will put it in the zip file so that other can use it.

bulletDownload Version: 24 dec. 1998, with bugfix 9 nov. 1999.
bulletPreview of game database
bulletPreview of combination viewer
bulletInstallation
bulletChanges from version 1.0
bulletExample of helptext
Explaination
bulletInserting in HTML file (APPLET Tag)
bulletMaking your own pieces
bulletDefining of language.
bulletGamefilelist (pgnlist.txt)
bulletCombinations
bulletFor developers

 

Installation:

bulletCopy all files to the same directory.
bulletEdit sjkbase.html and problem.html to your needs.
bulletMake one or more pgn-files. You can export it from your Chessprogram or use Hansen's utilities for converting to pgn. Edit pgnlist.txt to point to this files.
bulletMake combination files.
bulletCopy all files to the internet server.

List of files to copy to the Internet Server. (All other files in this pakkages is for documentation only.)
Copying to application directory (codebase).
sjkbase.jar Appletfiles, used by the applet (application)
navbar.gif Navigationbuttons in the applet
brikker40.gif Pieces with size=40x40 pixel
brikker30.gif Pieces with size=30x30 pixel
Messages.txt Default language file.
Messages_XX.txt Language files. see under
 
Copying to the html site.
sjkbase.html Example of html file for showing games.
problem.html Example of html file for showing combinations
pgnlist.txt Example of gamelist file
test1.pgn Example of a game library in pgn
test2.pgn Another example of pgn file
comb1.txt Example combination file in pgn format
comb2.txt Example combination file in epd format
comb3.txt Example combination file in (modified) fen format

Language files.

FilenameLanguageDateMade by
Messages.txtEnglish24 dec. 98 
Messages_DE.txtGerman27 dec. 98Manfred Rosenboom
Messages_ES.txtSpanish4 may 00Iván Carrasco
Messages_FR.txtFrench11 jan. 00Max Thiercy
Messages_NL.txtDutch7 jan. 99Johan Voorberg
Messages_NO.txtNorwegian24 dec. 98 

The application and the html site don't need to be the same. If it's not the same, you must add codebase="applicationsite" to the APPLET tag.
NB! It must be on the same Internet server.
If you do this and have more than one site showing the applet it will be mush faster the second time.

 

If it not work:

bulletAll files are case sensitive.
bulletI have tested this with Microsoft Explorer 4.01 and Netscape 4.5. If you have earlier version of the browser, mybe you must upgrade. For Mocrosoft Explorer it is only nessesary to upgrad the Java VM. You find it on:
http://www.microsoft.com/java

 

Helpingtools

bulletExplanation of PGN and FEN format:
http://home.sol.no/~malin/sjakk/download/pgn.zip
bulletHansen's utility
http://home.sol.no/~malin/sjakk/download/hansen.zip

 

Inserting in HTML file (APPLET Tag)

For showing game database

    <APPLET CODE="Sjkbase.class" ARCHIVE="sjkbase.jar" WIDTH="" HEIGHT="">
      <PARAM NAME="Headline" VALUE="">
      <PARAM NAME="Filelist" VALUE="">
      <PARAM NAME="Pieces" VALUE="">
      <PARAM NAME="bgcolor" VALUE="">
      <PARAM NAME="Coordinate" VALUE="">
      <PARAM NAME="Quiz" VALUE="">
      <PARAM NAME="Language" VALUE="">
      <PARAM NAME="Country" VALUE="">
    </APPLET>

For showing combinations

    <APPLET CODE="Problem.class" ARCHIVE="sjkbase.jar" WIDTH="" HEIGHT="">
      <PARAM NAME="Headline" VALUE="">
      <PARAM NAME="Filelist" VALUE="">
      <PARAM NAME="Pieces" VALUE="">
      <PARAM NAME="bgcolor" VALUE="">
      <PARAM NAME="Coordinate" VALUE="">
      <PARAM NAME="Language" VALUE="">
      <PARAM NAME="Country" VALUE="">
    </APPLET>
Forklaringer:
CODE=""
This is the startup class and could not be changed and must be Sjkbase.class for showing games and Problem.class for showing combinations.

ARCHIVE="sjkbase.jar"
ARCHIVE This is the archive file with all class files.

WIDTH=""
WIDTH is the width of the APPLET. This must be big enough to cover the APPLET.
With pieces 40x40 pixel this could be 550. Try viewing the applet with several browsers.

HEIGHT=""
HEIGHT is the height of the APPLET. If this is too small you will not see the hole board. With pieces 40x40 pixel this could be 410. Try viewing the applet with several browsers.

<PARAM NAME="Headline" VALUE="">
Headline of the Applet.

<PARAM NAME="Filelist" VALUE="">
Name (url) of the gamelist/combination file.

<PARAM NAME="Pieces" VALUE="">
Filename of the pieces file.

<PARAM NAME="bgcolor" VALUE="">
Background color.

<PARAM NAME="Coordinate" VALUE="">
For showing coordinates on the chessboard set this to YES.

<PARAM NAME="Quiz" VALUE="">
For not to show the next move when going forward this is set to YES.

<PARAM NAME="Language" VALUE="">
Language to use. (See Defining a language) Use this for testing.

<PARAM NAME="Country" VALUE="">
Country of the OS. (See Defining a language) Use this for testing.

 

Pieces

Fileformat: Transparent gif.
Height: The same as the height of a square on the chessboard.
Width: 12*height

The layout must be each pieces side by side in one file. The order of the pieces must be:
White Pawn, White Knight, White Bishop, White Rook, White Queen, White King, Black Pawn, Black Knight, Black Bishop, Black Rook, Black Queen and Black King.

Example:
Eksempel på brikkefil

 

Defining a language.

Java has methodes to automatic finding the right language (ISO 639) and country (ISO 3166). For Norway it will be language=no and country=NO. Not all Country have just one language. Ex. the french area of Canada would have fr and CA.

Not all browsers are suporting the language code so you should try to just use country code.

When the applet starts it try to suport your country and language in this order:
bullet Both country and language.
bullet Just language.
bullet Just Country.
bullet Default (English).
You could set the parameter "Country" an "Language" in the html file to force the applet to use a preferred language. The filename of the language file must be "Messages_xx_YY.txt" where xx is the language code and YY is the country. If this file is not found it will use "Messages.txt".

The format of the Message_xx_YY.txt file are:

Key = Translation
Make a copy of "Messages.txt" and work with this file. You could use any ANSI text editor.

(The applet could also be using the java standard for language files (Messages.properies). This will speed it up a litle but give me some errors when testing it on the Internet. (No download, Netscape could not get it from the jar file etc.)

If you make a new language file please see the licensing in the top of this document.

 

Changes from earlier versions

09 nov. 1999
Fixing a bug when a pawn promote.

24 dec. 1998
Converting to Java 1.1
Using jar archive
International version
Change of how the layout window are set up.
All the pieces in the same gif-file.
Suports short notation and comment (also NAG) in the pgn-file
Changes of the combination format.

28 jan. 1998
Starting version. Use Java 1.0
Reading pgn and fen files and showing this on a board.

 

Game filelist (partier.txt)

This file are used by the Sjkbase to finding the right pgn-file.
Edit this to point to your own pgnfiles.

Format:

Line 1
Text to the user for picking up the first pgnfile.

Line 2
Filename of the first pgnfile.

Line n-1
Text to the user for picking up the last pgnfile.

Line n
Filename of the last pgnfile.

PGN, EPD and FEN format is a standard format for exchange games and position on the Internet.
You could download an explanation of this format from:
http://home.sol.no/~malin/sjakk/download/pgn.zip

 

Combinations

This files are used by the combination viewer.
It is possible to use tree different format.

PGN Format: (Eks. comb1.txt)
The position must be in the FEN tag and the setup tag must be 1. The title of the combination is White and/or Black tag. The quiz text is the comment before move one. The answer is the rest of the game (moves + comment).

EPD Format: (Eks. comb2.txt)
The title of the combination must be in c0. The quiz text must be in c1. The answer is c2 + pv.

Modified FEN format (Eks. comb3.txt)
Line 1 must be <Title> (Saying: the next line is the title of the combination)
Line 2 Title text.
Line 3 Must be: <FEN> (Saying: the next line is FEN position)
Line 4 FEN position.
Line 5 Must be: <Quiz> (Saying: the next line is combination text)
Line 6 Combination text. (Could be more than one line)
Line 7 Must be: <Answer> (Saying: the next line is the answer to the combination)
Line 8 Answer text. (Could be more than one line)
Line 9 is line 1 for the next combination.

PGN,EPD and FEN format is a standard format for exchange games and position on the Internet.
You could download an explanation of this format from:
http://home.sol.no/~malin/sjakk/download/pgn.zip

 

Example of helptext

You could make a helptext on the side with the applet.
Make hyperlink to the pgn-file for the browser who could not see the applet.
The button below the board are in the navbar.gif. This buttons are also in separate files for use in helptext.
starten.gifTo the start position.
dpilv.gifFive halfmove back.
pilv.gifOne halfmove back.
oppdater.gifRefresh the board.
pilh.gifOne halfmove forward.
dpilh.gifFive halfmove forward.
slutten.gifTo the end of the game.
snu.gifBlack at bottom. (Toggle)
quiz.gifQuiz mode.

 

For developers

The file sjkbase.jar is a archive file with all class files.
The documentation for the class files is here.
You can also download the sourcefiles from here.

 

Odd Gunnar Malin, 24 dec. 1998

Epost: malin@online.no