Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. struct Playing {}
  2. struct Won {}
  3. struct Lost {}
  4.  
  5. fn beginGame() -> Playing {
  6. Playing {}
  7. }
  8.  
  9. fn winGame(p: Playing) -> Won {
  10. Won {}
  11. }
  12.  
  13. fn loseGame(p: Playing) -> Lost {
  14. Lost {}
  15. }
  16.  
  17.  
  18. fn main() {
  19. let game0 = beginGame();
  20. let game1 = winGame(game0);
  21. let game2 = loseGame(game0);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement