MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / generateInitialPattern

Method generateInitialPattern

lib/GameOfLifePlugin/src/GameOfLifePlugin.cpp:301–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301void GameOfLifePlugin::generateInitialPattern(uint8_t gridId)
302{
303 uint32_t gridDataIndex = 0U;
304
305 randomSeed(ESP.getCycleCount());
306
307 while (m_gridSize > gridDataIndex)
308 {
309 m_grids[gridId][gridDataIndex] = random(INT32_MAX);
310 m_grids[gridId][gridDataIndex] |= (0 == random(2)) ? 0x00000000 : 0x80000000;
311
312 ++gridDataIndex;
313 }
314}
315
316bool GameOfLifePlugin::getCellState(uint8_t gridId, int16_t x, int16_t y)
317{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected