-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.h
More file actions
148 lines (90 loc) · 2.42 KB
/
util.h
File metadata and controls
148 lines (90 loc) · 2.42 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#ifndef UTIL_H_INCLUDED
#define UTIL_H_INCLUDED
/*******************
* *
* Saisies *
* *
*******************/
// Entiers
int saisir_entier(void);
// Caractères
char saisir_caractere(void);
// Chaînes de caractères
char * saisir_chaine(void);
/*******************
* *
* Affichages *
* *
*******************/
void afficher_chaine_masquee(const char * chaine, const char * trouves);
/*******************
* Travail *
* sur *
* chaines *
*******************/
char caractere_dans_chaine(const char * chaine, const char caractere);
char * chaine_vers_caracteres_uniques(const char * chaine);
/*******************
* *
* Stockage *
* *
*******************/
typedef struct _liste_mot
{
char **mots;
int nombre;
} LISTE_MOT;
LISTE_MOT * lire_mots(const char *nom_fichier);
void rand_init(void);
void melanger_mots(LISTE_MOT * liste_mots);
/*******************
* *
* Arguments *
* *
*******************/
LISTE_MOT *manage_arguments(int argc, char *argv[]);
/*******************
* *
* Scores *
* *
*******************/
typedef struct _score
{
int valeur;
char *nom_joueur;
struct _score *superieur;
struct _score *inferieur;
} SCORE;
typedef struct _tableau_score
{
short nombre_scores;
SCORE *premier;
SCORE *dernier;
} TABLEAU_SCORE;
void ajouter_score(TABLEAU_SCORE *tableau, int nouveau_score_valeur, char *nom_joueur);
void afficher_tableau_score(TABLEAU_SCORE *tableau);
/*******************
* *
* Base de données *
* *
*******************/
void db_create(const char *db_filename);
void db_set(const char *db_filename, int niveau, TABLEAU_SCORE *tableau);
TABLEAU_SCORE* db_get(const char *db_filename, int niveau);
/*******************
* Système *
* de *
* fichiers *
*******************/
void db_creer_si_existepas(const char *db_filename);
/*******************
* *
* Logique *
* *
*******************/
short menu();
short choisir_niveau();
char * demander_mot(void);
int jeu(const char *mot);
void scores(TABLEAU_SCORE *tableau_scores_1, TABLEAU_SCORE *tableau_scores_2, TABLEAU_SCORE *tableau_scores_3);
#endif // UTIL_H_INCLUDED