Skip to main content
added 47 characters in body
Source Link
Blauelf
  • 21k
  • 2
  • 13
  • 22

You use local stack variable for the board, local variables will be deleted on leaving the function, should probably use a global variable. Not sure how d is passed, maxbe init has a parameterLocal variables of same name shadow global ones (compiler flag -Wshadow will warn in that case). 

Your single loop would output just the elements of the diagonale, needs nested loops just like when filling, and break leaves the current loop.

You use local stack variable for the board, local variables will be deleted on leaving the function, should probably use a global variable. Not sure how d is passed, maxbe init has a parameter. Your single loop would output just the elements of the diagonale, needs nested loops just like when filling, and break leaves the current loop.

You use local stack variable for the board, local variables will be deleted on leaving the function, should probably use a global variable. Local variables of same name shadow global ones (compiler flag -Wshadow will warn in that case). 

Your single loop would output just the elements of the diagonale, needs nested loops just like when filling, and break leaves the current loop.

Source Link
Blauelf
  • 21k
  • 2
  • 13
  • 22

You use local stack variable for the board, local variables will be deleted on leaving the function, should probably use a global variable. Not sure how d is passed, maxbe init has a parameter. Your single loop would output just the elements of the diagonale, needs nested loops just like when filling, and break leaves the current loop.