Skip to content

Instantly share code, notes, and snippets.

@noir-neo
Created February 25, 2014 22:11
Show Gist options
  • Select an option

  • Save noir-neo/9218971 to your computer and use it in GitHub Desktop.

Select an option

Save noir-neo/9218971 to your computer and use it in GitHub Desktop.
function getDirection(dx, dy) {
if (dx == 0) {
return dy + 1;
} else {
return Math.abs(dx - 2) + dy * .5 * dx;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment