Witam, mam problem ze strukturą:
#include "common.h"
int checkPossibleMoves(struct BoardField** board, int width, int height, int pieceX, int pieceY)
{
if ((pieceX > width && pieceX < 0) || (pieceY > height && pieceY < 0))
return 0;
else {
// int x=pieceX;
// int y=pieceY;
int z = (board[pieceX][pieceY]).piece;
printf("%d ", z);
printf("%d ", width);
printf("%d ", height);
printf("%d ", pieceX);
printf("%d ", pieceY);
return 1;
}
}
w tak napisanym kodzie wszystko sie sypie, ale jeżeli wpiszę z palca powiedzmy (board[0][0]).piece; śmiga jak trzeba.