3 ms·
Nice work, but unfortunately it doesn't seem to implement the card draw algorithm correctly, which leads to unplayable games pretty quickly (the card draw algor
by necubi 13y ago
Nice work, but unfortunately it doesn't seem to implement the card draw algorithm correctly, which leads to unplayable games pretty quickly (the card draw algorithm must pick the same number of 1s and 2s over a short time horizon for the game to be playable).
The actual algorithm used by Threes is as follows:
1. At start, shuffle a deck containing 4 each of ones, twos, and threes.
2. For each round, roll a 21-sided die. If it's a one and the largest value on the board V is >= 48, choose a tile that is randomly chosen from the range 3 to V/8 inclusive. Otherwise, take the next tile off the stack.
3. If the stack is empty, refill it as above.
Here's a Scala implementation of this logic: https://github.com/mwylde/Threes.scala/blob/master/src/main/scala/com/micahw/threes/Game.scala#L176 https://github.com/mwylde/Threes.scala/blob/master/src/main/....
- evan_ 13y agoYeah, I know- it's just drawing a random number. I didn't have space to improve on that.