|
During my last visit to Zorastavia, I came upon a game played in many casinos in that little known Eastern European country.
The gambler starts off with 64 Sules having payed considerably extra to enter the game in the first place*, and a full deck of randomly shuffled numbered cards (numbered 1 to 52). The first card is drawn and the gambler then has to bet (up to a maximum of the 64 Sules he or she holds) on whether that card is higher than the next card that will be drawn out - if the card drawn out is lower the gambler gets double his bet back (ie if he put down 5 Sules and won he would be on a total of 69 Sules for the next round), otherwise he looses it. Whether the gambler wins or looses he gets to bet on the following card but with the limitation that he can only bet a maximum of twice the stake (assuming he has the money to do so) he put on the previous round. The game continues for 51 rounds so the final round assuming the gambler has been paying attention he knows exactly whether he will win or loose his hand). If at any point the gambler bids 0 Sules he or she will take no further part in the game for the rest of that deck. The Challenge then is to write a program that is a good player of the above game, being able to card count is assumed to keep the problem from being a chore programatically. Each round will consist of a separate run of your program which will be passed the following lines via the standard input
Total Money currently held and will be expected to output a single value as to how much it will bet. The problem will be judged on results based on a number of full games (probably in the order of 100) each starting from scratch at 64 sules total. Each program will face the same decks and the program(s) that have won the most (or lost the least) after all the games will be crowned winner. Entries should be put in your files with a link in a comment on this diary - and the closing date from entries is 1pm GMT on Monday the 20th, a simple test framework will be posted at least a prior weak prior to the deadline. *(I conveniently forget the exact number)
|