// cat_amongst_pigeons.c // // Written by YOUR-NAME (YOUR-ZID) // on TODAYS-DATE // // Places cats and pigeons on a board, checking they are not next to each other. #include // Constants #define SIZE 10 enum entity { CAT, PIGEON, EMPTY }; struct square { enum entity entity; }; // Function prototypes void print_map(struct square city[SIZE][SIZE]); int main(void) { struct square city[SIZE][SIZE]; int row; int col; //TODO: Complete the program } // Print the map void print_map(struct square city[SIZE][SIZE]) { printf("\n------------------------------------------\n"); for (int i = 0; i < SIZE; i++) { for (int j = 0; j < SIZE; j++) { printf("|"); if (city[i][j].entity == CAT) { printf("^-^"); } else if (city[i][j].entity == PIGEON) { printf("<0 "); } else if (city[i][j].entity == EMPTY) { printf(" "); } } printf("|\n"); printf("------------------------------------------\n"); } }