Created
April 9, 2018 07:16
-
-
Save subhodi/5ac59d371c2e6993cffd36b237ac4e21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
contract demo { | |
mapping(uint => uint) public map; | |
event Finished(); | |
function seedMap(uint _start, uint _end) public { | |
for(uint i=_start;i<_end;i++) { | |
map[i] = i; | |
} | |
} | |
function open(uint _key, uint _value) public { | |
map[_key] = _value; | |
Finished(); | |
} | |
function query(uint _key) constant returns(uint) { | |
return map[_key]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment