Sunday, March 20, 2005

SVG Xiang Qi

Created a Chinese Chess Board game at http://www.hiew.per.sg.

Currently this game is just a simple game board with mouse clickable seeds. You can move the seed according to the Chinese Chess rule. Only rule not implemented is the Jiang to Shuai facing constrain.

Intend to add in the Player to Computer and Player to Remote Player interface. I am thinking of using existing Chess Engine for the Player to Computer interface. I am also thinking of using Java or XML-RPC to accomplish the peer-to-peer connection. Even thinking of using Existing IM interface to pass the moves.

A less real time mode will be using the PHP with session enabled and the session ID passed between two person so that they could use common variables. It means that the page will be an iframe in the main page that reloads at regular intervals of 1 sec. Since they use common session ID (by setting no cookies. A very bad practice of using the session id) Not bad if the number of users are small.

First user will login to the web page and in the process insert the session ID into the database. The second person simply login and look for the first person. Once selected, the first person's ID will be copied from the database and both can start to use common variables. Of course it does not stop a third person to access the session ID. The program will have to prevent any one other than the first two from playing.

Wednesday, March 09, 2005

SVG Charts

Added two charts at http://www.hiew.per.sg.

The Line Chart Form is for generating line charts and bar charts. Simple line and bar charts can be created by simply entering the data, separated by commas, into the input fields. You can experiment with the form and see immediate results in the chart below it.

The program is used in conjunction with Adobe SVG Viewer plugin. I is a very powerful Scalable Vector Graphic viewer that conforms to the WWW consortium svg standard.

The Line Chart Form also includes 5 different type of statistical line charts.

1. X-Bar Chart. (Up to 10 input lines. Can accomodate a lot of data.)
2. R Chart. (Up to 10 input lines. Can accomodate a lot of data.)
3. P Chart. (Only two lines are allowed. The first is the value. And the second the total. Percentage is calculated by the program.)
4. U Chart. (Only two lines are allowed. The first is the value. And the second the total.)
5. C Chart. (Up to 10 input lines. Can accomodate a lot of data.)

The calculations are all done externally to the SVG. It has not been tested thoroughly for calculation errors.

The Pie chart form is a simple flat pie chart program that also uses SVG to display. Up to a total of 16 pies can be created. I have not animate the pies to extend out when the mouse is over it.