int consultar() { // int i; for (i = 0; i < 16; i++) { if (matriz[i][0] == estado[0] && matriz[i][1] == estado[1] && matriz[i][2] == estado[2] && matriz[i][3] == estado[3]) { return i; } } return -1; }
This function is a searching function that returns the position of the searched element in the matrix.