Created
May 10, 2021 14:32
-
-
Save RahmatSaeedi/a3fa9b9a0604e759a0df838c8955445d to your computer and use it in GitHub Desktop.
CodeSignal - Arcade - Intro - JS - chessBoardCellColor
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
function chessBoardCellColor(cell1, cell2) { | |
return (cell1.charCodeAt(0) - cell2.charCodeAt(0) + cell1.charCodeAt(1) - cell2.charCodeAt(1)) %2 == 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment