Created
May 28, 2015 05:52
-
-
Save twogood/1663de8a3590dd4f0acf to your computer and use it in GitHub Desktop.
Code of the day
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 counter(colAdd, rowAdd) { | |
var count = 1; | |
var x, y; | |
for (x = move.col + colAdd, y = move.row + rowAdd; | |
isOwnedByCurrentPlayer(x, y); | |
count++, x += colAdd, y += rowAdd) { | |
} | |
for (x = move.col - colAdd, y = move.row - rowAdd; | |
isOwnedByCurrentPlayer(x, y); | |
count++, x -= colAdd, y -= rowAdd) { | |
} | |
return count; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment