Skip to content

Instantly share code, notes, and snippets.

@elken
Created August 15, 2016 22:27
Show Gist options
  • Save elken/6bd0eb3f44249a5100720c8dcd8a778f to your computer and use it in GitHub Desktop.
Save elken/6bd0eb3f44249a5100720c8dcd8a778f to your computer and use it in GitHub Desktop.
@a=split(/\s+/,<>);while(1){$a=@a[0]<=>@a[2];$b=@a[1]<=>@a[3];print((N,'',S)[$b+1].(W,'',E)[$a+1].$/);@a[2]+=$a;@a[3]+=$b;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment