Skip to content

Instantly share code, notes, and snippets.

@resilience-me
Created January 13, 2019 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save resilience-me/69d605844973df694c613ba71439a6fa to your computer and use it in GitHub Desktop.
Save resilience-me/69d605844973df694c613ba71439a6fa to your computer and use it in GitHub Desktop.
function getRandomNumber(uint _treasureMap, uint _iterations) returns (uint) {
for(uint i = 0; i<_iterations; i++) {
_tresasureMap ^= blockhash(block.number % _treasureMap);
}
return _treasureMap;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment