Skip to content

Instantly share code, notes, and snippets.

@mustmodify
Last active May 14, 2019 02:16
Show Gist options
  • Save mustmodify/f9fd384669d588d60006b5f46cf32eae to your computer and use it in GitHub Desktop.
Save mustmodify/f9fd384669d588d60006b5f46cf32eae to your computer and use it in GitHub Desktop.
function maxInARow(grid)
{
int max_in_a_row = 0;
for(int checkRow = 0; checkRow < maxRows; checkRow++;)
{
for(int checkCol = 0; checkCol < maxCols; checkCol++;)
{
max_in_a_row = Math.max( max_in_a_row, downright_in_a_row(grid, checkCol, checkRow), downleft_in_a_row(grid, checkCol, checkRow),
max_horizontal(grid, checkCol, checkRow), max_vert(grid, checkCol, checkRow))
}
}
return max_in_a_row
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment