Added my name & continued at ms_board.h

This commit is contained in:
MarcUs7i 2025-01-28 16:39:02 +01:00
parent f5175c483d
commit 16732fd116
10 changed files with 52 additions and 26 deletions

View file

@ -3,7 +3,7 @@
* ---------------------------------------------------------
* Exercise Number: n/a
* Title: general.h
* Author: P. Bauer, S. Schraml, */<your name>/*
* Author: P. Bauer, S. Schraml, Marc Tismonar
* ----------------------------------------------------------
* Description:
* General usable definitions and types.
@ -29,23 +29,30 @@ typedef unsigned short ColAddr;
typedef char RowAddr;
/** CellMarker: The enumeration of cell markers. */
typedef enum {
NONE, /* cell is not marked */
MINE_DETECTED, /* cell carries a mine */
MINE_SUSPECTED /* cell is suspected to carry a mine */
} CellMarker;
/** GameMode: The enumeration of defined game modes (sizes) */
typedef enum {
BEGINNER, /* a 'small' game, e.g. 8x8 cells having a low number of mines (e.g. 10) */
ADVANCED, /* a 'medium' game, e.g. 16x16 cells having a medium number of mines (e.g. 40) */
EXPERT, /* a 'large' game, e.g. 26x18 cells having a high number of mines (e.g. 99) */
CUSTOM, /* a customized game, number of columns, rows, and mines are defined by the user */
} GameMode;
/** GameState: The enumeration of game states. */
typedef enum {
INVALID, /* default state */
IN_PROGRESS, /* the game is currently played */
SOLVED, /* the game was successfully completed */
FAILED /* the game was not successfully completed */
} GameState;
/** Action: The enumeration of possible user input actions. */
typedef enum {
UNKNOWN, /* default state, input was not recognized */
CELL_SELECT, /* the user entered a (possibly invalid) cell address. */
MARK_MINE, /* the action to mark the selected cell having a mine */
@ -53,6 +60,7 @@ typedef char RowAddr;
CLEAR_MARKER, /* the action for removing a marker on the selected cell */
UNCOVER, /* the action to uncover a (possibly) selected cell */
QUIT_GAME, /* the action to terminate the game */
} Action;
/** Convenience macro do get maximum of two numbers */
#define MAX(x, y) ((x) > (y) ? (x) : (y))