Created
October 4, 2016 17:50
-
-
Save zepedebo/ab57759002d60336baa4ba8f07b0ab6f 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
do { | |
var coyote = Predator() | |
var roadrunner = Prey() | |
coyote.attach(device:"rocket", location: "back") | |
coyote.attach(device:"roller skates", location: "feet") | |
coyote.attach(device:"helmet", location: "head") | |
try coyote.navigate(feature: "Sharp Turn") | |
try coyote.navigate(feature: "Chasm") | |
try coyote.navigate(feature: "Low Bridge") | |
coyote.capture(prey: roadrunner) | |
} catch NavigationError.Explode { | |
} catch NavigationError.Crash { | |
} catch NavigationError.Fall { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment