Well, after pondering about the game I had many strategies in mind and in order to check them out, to compare them and to see how they react on each other I wrote another tiny Applet.
The Applet
The Applet basically works as an arena for strategies which come as classes themselves and which are loaded according to a list, which is passed to the applet on initialization. On the a later page you can see how to create a strategy class of your own and how to compete with other strategies.
The Applet is not really interactive, once started it just lets those strategies compete. The only thing you can do is, click into the applet, to stop it. When you click again to continue, you highlight the strategy corresponding to the line you clicked on. The last three strategies clicked are highlighted in different colours, allowing you, to watch their progress more easily.
Note that the Applet starts up a bit slow, since it consists of four classes and afterward has to parse and load the strategies, one class per strategy. You can watch the loading of strategies on the Java Console window (unless you have a stupid Internet Explorer without console). For those of you who have to pay their online time: Once play started no net connection is needed any more...
The output of the Applet looks as following: The first line contains a counter how many turns (or rounds) have been played. The following lines each contain one strategy in the following format:
Rank.:
Name of Class
Total points
(Number betted last round)
Total point difference to next better program
Total point difference to leader
For an extinct strategy there is the round of extinction in square brackets (due to a bug, the last column still changes for extinct programs, the rest is frozen). Programs disqualified due to a illegal bet, can be recognized by a point total of -1000.
If I have the time I'd like to display a graphical history of each strategies scores in a future version of the applet. If anyone wants to help me with that, please drop me a mail...
Comments to the demo strategies
The above demonstration contains a few of the strategies, I have invented yet. I will not explain the more complex ones in detail, cause I dont want to direct your ideas in any particular direction. The source code of a few of them can be found on the next page .
Just a few comments.
Const1, Const13, Const23, Const99: These stupid strategies bet the same amount every round.
Focus: This is a rather complicated predecessor of my very best strategy so far (which I will present only later). Though cooperative in spirit, it spends some effort to outanalyze potentially aggressive strategies...
Nihilist: He doesn't bet unless the carry of the preceding round is considered high and then he bets one.
Random11: Rolls a eleven sided dice to choose his bet.
Shark0, Shark1, Shark7: A list of increasing successful aggressive strategies which have not much understanding of what happens arround them.
Strat23: A very simple strategy which will be displayed in source code later...
Tyranno5, Tyranno5b: These slight variations of a certain simple aggression both do a good job eliminating the very friendly strategies in their environment until they die themselves.
Please think of interesting strategies and let me know about them!! Java-Classes make things easier for me, but I am open to any form of program snippet or natural language description.
On the next page you can learn, how to package your strategy into a Java class.