Guest User

Untitled

a guest
Jul 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. pragma solidity ^0.4.4;
  2.  
  3. contract test {
  4. enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill }
  5. ActionChoices _choice;
  6. ActionChoices constant defaultChoice = ActionChoices.GoStraight;
  7.  
  8. function setGoStraight(ActionChoices choice) public {
  9. _choice = choice;
  10. }
  11.  
  12. function getChoice() constant public returns (ActionChoices) {
  13. return _choice;
  14. }
  15.  
  16. function getDefaultChoice() pure public returns (uint) {
  17. return uint(defaultChoice);
  18. }
  19. }
Add Comment
Please, Sign In to add comment