Game results
Each game has a fixed way to turn numbers into its result. f is a number from the previous chapter.
Dice
Uses 1 number, stretched to 0.00–100.00 and cut to 2 decimals.
roll = (f * 10001).floor / 100.0
Mines
Uses 3 numbers to place 3 mines on 25 squares. Each one picks from the squares still left, so no square is picked twice.
left = (1..25).to_a
mines = floats.first(3).map { |f| left.delete_at((f * left.size).floor) }
Crash
Uses 1 number to set the crash point. 0.99 is divided by it and cut to 2 decimals, and it never goes below 1.00.
multiplier = ((0.99 / f * 100).floor / 100.0).clamp(1.0, 1000000)
Plinko
Uses 16 numbers, one per row. Each is multiplied by 2 and rounded down. 0 falls left and 1 falls right. The slot is how many times the ball fell right.
slot = floats.first(16).count { |f| (f * 2).floor == 1 }
Limbo
Uses 1 number to set the multiplier, the same way as Crash.
multiplier = ((0.99 / f * 100).floor / 100.0).clamp(1.0, 1000000)
Keno
Uses 10 numbers to draw 10 of 40. Each one picks from the numbers still left.
left = (1..40).to_a
hits = floats.first(10).map { |f| left.delete_at((f * left.size).floor) }