Skip to content

Instantly share code, notes, and snippets.

@zepedebo
Created October 4, 2016 17:50
Show Gist options
  • Save zepedebo/ab57759002d60336baa4ba8f07b0ab6f to your computer and use it in GitHub Desktop.
Save zepedebo/ab57759002d60336baa4ba8f07b0ab6f to your computer and use it in GitHub Desktop.
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