Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pragma solidity ^0.4.4;
- contract test {
- enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill }
- ActionChoices _choice;
- ActionChoices constant defaultChoice = ActionChoices.GoStraight;
- function setGoStraight(ActionChoices choice) public {
- _choice = choice;
- }
- function getChoice() constant public returns (ActionChoices) {
- return _choice;
- }
- function getDefaultChoice() pure public returns (uint) {
- return uint(defaultChoice);
- }
- }
Add Comment
Please, Sign In to add comment