//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.4.18; contract SimpleStore { function getHashArray() public view returns(uint[]){ bytes32 hash = keccak256(now); uint[] memory ret = new uint[](32); for(uint i=0; i<32; i++){ ret[i] = uint(hash[i]); } return ret; } function swap(uint[] a, uint l, uint r) private pure { uint t = a[l]; a[l] = a[r]; a[r] = t; } function bubblesort(uint[] a) private pure { uint len = a.length; for(uint i=0; i<len-1; i++){ for(uint j=i; j<len; j++){ if(a[j] < a[i]){ swap(a, i, j); } } } } function get() public view returns(uint[]){ uint[] memory a = getHashArray(); bubblesort(a); return a; } }
0.4.18