Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Playing {}
- struct Won {}
- struct Lost {}
- fn beginGame() -> Playing {
- Playing {}
- }
- fn winGame(p: Playing) -> Won {
- Won {}
- }
- fn loseGame(p: Playing) -> Lost {
- Lost {}
- }
- fn main() {
- let game0 = beginGame();
- let game1 = winGame(game0);
- let game2 = loseGame(game0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement