Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created August 15, 2016 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/54462d18b218598b57a917a305db04be to your computer and use it in GitHub Desktop.
Save zoffixznet/54462d18b218598b57a917a305db04be to your computer and use it in GitHub Desktop.
sub distance (\xₙ,\xₒ,\yₙ,\yₒ) { sqrt (xₙ − xₒ)² + (yₙ − yₒ)² }
say 'Calculating distance traveled by airplane';
my $dₐ = distance 1, 1, 3, 4;
say 'Calculating distance traveled by spaceship';
my $dₛ = distance 1, "oops", 500, 400;
say "The difference is {$dₛ − $dₐ}";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment