Created
February 28, 2017 10:35
-
-
Save User4574/1cb41821138199d02b34b67d60f32c4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> 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