From 62535edbf42275928556f78aa52d3312b5c883cd Mon Sep 17 00:00:00 2001 From: Yaroslav Orlianskyi Date: Sun, 5 Jun 2022 18:50:46 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20'fin?= =?UTF-8?q?al'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- final/game.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 final/game.h diff --git a/final/game.h b/final/game.h new file mode 100644 index 0000000..4a8df69 --- /dev/null +++ b/final/game.h @@ -0,0 +1,49 @@ +#include +#define BLANK ' ' +/** + * Function draw game field + * @param rows count of rows + * @param columns count of columns + * @param field hold 2d array of characters in game + */ +void game_field(const int rows, const int columns, char field[rows][columns]); + + +/** + * Check fields rows if there are same characters + * @param rows count of rows + * @param columns count of columns + * @param field hold 2d array of characters in game + * @return true, if columns are complete; false otherwise + */ +bool check(const int rows, const int columns, char field[rows][columns]); + + + +/** + * Function returns 2D array after moving characters based on player input + * When characters are not same, nothing happens and warning appears + * Function also find the most upper character and the lower character from columns + * @param rows count of rows + * @param columns count of columns + * @param field hold 2d array of characters in game + * @param x is column from where character should be moved + * @param y is column where character should be moved + */ +void down_possible(const int rows, const int columns, char field[rows][columns], int x, int y); + + +/** + * Function returns 2D array of randomly generated characters + * There must be two blank columns and other should be full of characters without '\0' or blank spaces + * @param rows count of rows + * @param columns count of columns + * @param field hold 2d array of characters in game + */ +void generator(const int rows, const int columns, char field[rows][columns]); + + +/** + * Starts interactive ball sort puzzle game + */ +void ball_sort_puzzle();