It is the year 4579, humans now have 2 hands with 1001 fingers each. Chopsticks has become based off of points. And @Dennis has more rep then @Martin... Hand drawn red circles are now downvoted... Jon Skeet has hit 2 trillion rep on every SE site... Yeah scary I know
Chopsticks is a hand game that has been solved. So to get around this I have created it mutated. I increased the amount of fingers.
Rules of the game
The way this is played
Everyone starts with 2 hands. Each hand has 1001 fingers. Every hand starts with 1 (one) finger up on each hand. During your turn you can "hit" the other players hand. To hit you choose 1 of your hands to hit with and 1 of their hands to hit. The hand that was hit now has the amount of fingers that was their at first AND the amount of fingers that you had on the hand you hit with.
P2. Now fingers are
p1. The fingers are now P1:
If one hand gets to 1001 fingers up or more then that hand is out. Then player who got a hand out (for their turn) can "split". Splitting is when you take the hand that is in and halve the amount of fingers (round up) and give those fingers to the other hand getting it back in.
P1. Score is P1:
P1 splits for his turn and the score is P1:
1,1 and P2
The game ends when one player has both hands out. Points are scored by the amount of fingers the winner has. More points = better. The loser gains no points.
There are other rules that are used but these are the ones used here.
Everybody plays everybody (round robin)
Total your points up from every round you win. Then average everybody's points up. Divide your total by the average points and get your final score. Most points win.
Please do not try to solve the game. I actually have to be able to run it :P
Make sure the bot can run fast. With the length of rounds judging this will take a while
All libraries needed in your program must be in the default python library. Also list the ones you need imported. Imports will just be the basic import (for math I do:
Answers must work in Python 3.x
Your bot will be its own Python 3 file with a
play will be passed two lists of two numbers each. This number indicates how many fingers are up on each hand. The first list is your own hand.
If you choose to hit the other player's hand, then return a list of two bits. The first bit is the index of the hand you are using to hit (
0 for the first,
1 for the last), and the second bit is the index of the hand you are hitting on the opponent.
If you choose to split, return any other truthy value.
The controller can be found here. Save each bot in its own file and list each bot's filename (without
You and the other bot will take turns going first. If the game does not terminate in 100,000 (one hundred thousand) rounds, the game will be terminated and neither bot wins.
The controller is not protected against moves taking forever, but unnecessary overhead will be strongly frowned upon.