Created
July 6, 2012 05:55
-
-
Save z0w0/3058314 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
enum key { | |
key_a, | |
key_b | |
} | |
enum event { | |
quit, | |
key(key) | |
} | |
fn handle(event: event) { | |
alt event { | |
quit { quit_game(); } | |
key(which) { | |
alt which { | |
key_a { io::println("a was pressed!"); | |
key_b { io::println("b was pressed!"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment