Skip to content

Instantly share code, notes, and snippets.

@User4574
Created February 28, 2017 10:35
Show Gist options
  • Save User4574/1cb41821138199d02b34b67d60f32c4d to your computer and use it in GitHub Desktop.
Save User4574/1cb41821138199d02b34b67d60f32c4d to your computer and use it in GitHub Desktop.
> isCorner(3);
undefined
> rows
5
> cols
5
> isCorner
function isCorner(i) {
return
i == 0 ||
i == (cols - 1) ||
i == ((rows - 1) * cols) ||
i == ((rows * cols) - 1) ;
}
> isCorner(0);
undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment