-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.h
100 lines (85 loc) · 2.11 KB
/
gui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef __GUI_H__
#define __GUI_H__
#include <game.h>
#include <grid.h>
#include <save.h>
#ifdef _WIN32
#define ACCENT_E 130 // é
#define ACCENT_E2 136 // ê
#define ACCENT_E1 138 // è
#define ACCENT_A 133 // à
#define CEDILLE 135 // ç
#else //linux : pas d'accent
#define ACCENT_E 101 // e
#define ACCENT_E1 101 // e
#define ACCENT_E2 101 // e
#define ACCENT_A 97 // a
#define CEDILLE 99 // c
#endif
/**
* @brief Print the grid
*
* @param size int - size of the grid
* @param grid char** - pointer to the grid
*/
void print_grid(int size, char** grid);
/**
* @brief Print a player in a stream
*
* @param stream FILE* - The stream to print to
* @param player Player - The player to print.
*/
void printPlayer(FILE* stream, Player player);
/**
* @brief Print the playerlist in a stream.
*
* @param stream FILE* - The stream to print to.
* @param playerlist Player* - The list of the players.
* @param size int - The size of the playerlist.
*/
void printPlayerlist(FILE* stream, Player* playerlist, int size);
/**
* @brief Get an integer from the user
*
* @param message char* - the message to print to the user.
* @param min int - the minimum value of the integer.
* @param max int - the maximum value of the integer.
* @return int - the integer entered by the user.
*/
int get_integer_input(const char* message, int min, int max);
/**
* @brief Get a string from the user
*
* @param message char* - the message to print to the user.
* @return Word - the word entered by the user.
*/
Word get_string_input(const char* message);
/**
* @brief Get an input, just a validation to the next step
*
* @param message char* - the message to print to the user
*/
void validate(const char* message);
/**
* @brief Prints the logo 'BOGGLE' to stdin.
*
*/
void print_logo();
/**
* @brief Clear stdin.
*
*/
void clear();
/**
* @brief Wait some time.
*
* @param seconds int - the number of seconds to wait
*/
void wait(int seconds);
/**
* @brief Start a game.
*
* @return Player - The player who played.
*/
Player play();
#endif