2021-12-05 17:19:10 +01:00
|
|
|
#ifndef __ARRAY_2D_INT__
|
|
|
|
#define __ARRAY_2D_INT__
|
|
|
|
|
2023-08-10 11:13:06 +02:00
|
|
|
#include <stdio.h>
|
2021-12-05 17:19:10 +01:00
|
|
|
#include <stdlib.h>
|
2023-08-10 11:13:06 +02:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "character.h"
|
2021-12-05 17:19:10 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Prints a 2D array of integers.
|
|
|
|
*
|
|
|
|
* @param array
|
|
|
|
* @param number_of_rows
|
|
|
|
* @param number_of_columns
|
|
|
|
*/
|
|
|
|
void array_2D_int_print(int **array, size_t number_of_rows, size_t number_of_columns);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Read from stdin a 2D array (rectangle or square) of integers.
|
|
|
|
*
|
|
|
|
* @param number_of_rows
|
|
|
|
* @param number_of_columns
|
|
|
|
* @return int**
|
|
|
|
*/
|
|
|
|
int **array_2D_int_input(size_t *number_of_rows, size_t *number_of_columns);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Reverse the order of the rows of a 2D array of integers.
|
|
|
|
*
|
|
|
|
* @param array
|
|
|
|
* @param number_of_rows
|
|
|
|
* @param number_of_columns
|
|
|
|
* @return int**
|
|
|
|
*/
|
|
|
|
int **array_2D_int_reverse_rows(int **array, size_t *number_of_rows, size_t *number_of_columns);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Rotate a 2D array of integers by 90 degrees clockwise.
|
|
|
|
*
|
|
|
|
* @param array
|
|
|
|
* @param number_of_rows
|
|
|
|
* @param number_of_columns
|
|
|
|
* @return int**
|
|
|
|
*/
|
|
|
|
int **array_2D_int_rotate_90_degrees_clockwise(int **array, size_t *number_of_rows, size_t *number_of_columns);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Rotate a 2D array of integers by 90 degrees anticlockwise.
|
|
|
|
*
|
|
|
|
* @param array
|
|
|
|
* @param number_of_rows
|
|
|
|
* @param number_of_columns
|
|
|
|
* @return int**
|
|
|
|
*/
|
|
|
|
int **array_2D_int_rotate_90_degrees_anticlockwise(int **array, size_t *number_of_rows, size_t *number_of_columns);
|
|
|
|
|
|
|
|
#endif
|