src/kruskals.c
void init_kruskals(Tile tiles[ROWS][COLS], Player player) {
  // Logically clear walls array
  wall_index = 0;

  // Reset parent array to zeros
  memset(parent, 0, sizeof(parent));

  // Add horizontal walls to walls list
  for (int i = 1; i < ROWS - 1; i += 2) {
    for (int j = 2; j < COLS - 2; j += 2) {
      add_element(&tiles[i][j], walls, &wall_index);
    }
  }

  // Add vertical walls to walls list
  for (int i = 2; i < ROWS - 2; i += 2) {
    for (int j = 1; j < COLS - 1; j += 2) {
      add_element(&tiles[i][j], walls, &wall_index);
    }
  }
}
// Unused player argument passed to unify types into function pointer array
Unused player argument passed to unify types into function pointer array
Unused player argument passed to unify types into function pointer array
void init_kruskals(Tile tiles[ROWS][COLS], Player player) {
  wall_index = 0;
  memset(parent, 0, sizeof(parent));
  for (int i = 1; i < ROWS - 1; i += 2) {
    for (int j = 2; j < COLS - 2; j += 2) {
      add_element(&tiles[i][j], walls, &wall_index);
    }
  }
  for (int i = 2; i < ROWS - 2; i += 2) {
    for (int j = 1; j < COLS - 1; j += 2) {
      add_element(&tiles[i][j], walls, &wall_index);
    }
  }
}
void init_kruskals ( Tile tiles [ ROWS ] [ COLS ] , Player player ) { wall_index = 0 ; memset ( parent , 0 , sizeof ( parent ) ) ; for ( int i = 1 ; i < ROWS - 1 ; i += 2 ) { for ( int j = 2 ; j < COLS - 2 ; j += 2 ) { add_element ( & tiles [ i ] [ j ] , walls , & wall_index ) ; } } for ( int i = 2 ; i < ROWS - 2 ; i += 2 ) { for ( int j = 1 ; j < COLS - 1 ; j += 2 ) { add_element ( & tiles [ i ] [ j ] , walls , & wall_index ) ; } } }
Unused player argument passed to unify types into function pointer array
Unused player argument passed to unify types into function pointer array
// Logically clear walls array // Reset parent array to zeros // Add horizontal walls to walls list // Add vertical walls to walls list