//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.4.24; contract Playground { function generateTraits( bytes32 seed ) public pure returns (string) { uint256 rockColorFamily = uint256( seed ) % 10000; string memory featuredMaterial; if (rockColorFamily < 1800) { featuredMaterial = "IRON"; } else if (rockColorFamily < 4000) { featuredMaterial = "COPPER"; } else if (rockColorFamily < 6000) { featuredMaterial = "OXIDE"; } else if (rockColorFamily < 7800) { featuredMaterial = "PYRITE"; } else if (rockColorFamily <= 9500) { featuredMaterial = "GRANITE"; } else { featuredMaterial = "QUARTZITE"; } return featuredMaterial; } }
0.4.24