Conversions
Floats to Bytes
The hexadecimal 32-byte hash serves as the foundation for the Random Number Generator function (byteGenerator). Utilizing the implementation guidelines detailed in the cursor section, we harness sets of 4 bytes from this hash to produce individual game outcomes. These 4-byte segments undergo transformation into floats spanning the range of 0 to 1. Employing 4 bytes instead of one ensures enhanced precision during float generation. Subsequently, these floats constitute the core output of our provably fair algorithm, eventually manifesting into tangible game events.
From Floats to In-Game Actions
While the process of generating random outputs remains consistent across all our gaming experiences, a distinctive approach emerges when converting these floats into in-game actions.
The initial step in this conversion involves multiplying the randomly generated float by the total number of potential outcomes specific to the game at hand. For instance, in a game utilizing a 52-card deck, this calculation simply involves multiplying the float by 52. The resultant value is then mapped to a corresponding in-game action. For games necessitating multiple actions, this procedure persists, iterating through each consecutive set of 4 bytes within the generated result chain, as produced by the aforementioned byteGenerator function.
Rearrangement of Gaming Sequences
Consider video poker as an illustration: initially, there are 52 cards in the deck. Consequently, the first game event is determined by multiplying the float by 52. Subsequently, with each card dealt, the available card pool diminishes by one, influencing subsequent translations. This iterative process continues until all requisite game events are generated.
In the context of Mines and Keno, the procedure mirrors that of video poker, albeit with adjustments to accommodate tiles or grid locations instead of cards. The goal remains consistent: to ensure that each generated game event is unique within the sequence of results, preventing duplication.
Last updated