Instructions
Given the following board,

, determine the percentage chance that a player will win.
Rules of the game
- One six sided dice!
- Two players take turns rolling the dice and moving their pieces by increasing the position of their pieces by the number rolled on the dice. (Bonus points to evaluation functions that can take into account more than two players.)
- If the piece lands (stops) on:
- a snake's head, the piece must be relocated to the snake's tail.
- the bottom of a ladder, the piece must climb up to the top of the ladder.
- the top of a ladder or the tail of a snake, nothing else happens.
- A player can kill another player if his piece is on the other's at the end of his turn. (Not literally of course.) 'Dying' results in a player having to restart at position 0.
- If the player rolls a number which would cause his piece to move off the board, they stay where they are and the play passes on to the next player.
- The player that reaches 100 first wins.
Rules of the contest
Restrictions
- The aggregated bit-length of your constants cannot exceed 100000 bits.
- Your evaluation function cannot, on average, take a hundred times longer than a simulation.
- Your evaluation function cannot run 'probabilistic simulations'.
Other
- If
eval(p,b)is the evaluation function, it should return a value between0and1, where0indicates it is impossible for playerpto win, and1indicates it is absolutely certain playerpwill win for a given boardb.
Scoring
(As in the scoring of answers. ;))
The winning evaluation function is able to correctly evaluate the probabilities with the least percentage error on the basis of the averaged (mean) results of 100 simulations run per board on a total of 10 randomly generated boards. (By 'randomly generated board', I mean the players' pieces are in different positions... not the snakes or ladders!)
var test_board(player, postions)
{
var player_wins;
repeat(100)
{
// If player wins a game, increment player_wins.
if(run_game(positions) == player)
player_wins += 1;
}
return player_wins / 100.0;
}
var run_simulations()
{
var stack[];
repeat(10)
{
var positions[] = {random(101), random(101)};
stack.push(abs(test_board(positions) -
eval(PLAYER_A, positions)));
}
return stack.average();
}
Please post the inputs and results of your tests! (A table listing the ten different boards used, their evaluated and average values, times taken, and average percentage error.)
infinity >= 100.) – muntoo Jan 3 '12 at 9:10100000bits, if you want to be smart about it. :)) – muntoo Jan 3 '12 at 9:25