MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / throwDice

Function throwDice

libraries/randomHelpers/randomHelpers.cpp:124–135  ·  view source on GitHub ↗

typical use

Source from the content-addressed store, hash-verified

122
123// typical use
124uint8_t throwDice()
125{
126 if (__randomIdx < 16)
127 {
128 __randomBuffer = getRandom32();
129 __randomIdx = 32;
130 }
131 uint16_t rv = __randomBuffer % 6 + 1;
132 __randomBuffer >>= 3;
133 __randomIdx -= 3;
134 return rv;
135}
136
137
138uint8_t getRandom8()

Callers

nothing calls this directly

Calls 1

getRandom32Function · 0.85

Tested by

no test coverage detected