-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfonction.h
More file actions
55 lines (50 loc) · 1.96 KB
/
fonction.h
File metadata and controls
55 lines (50 loc) · 1.96 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
#ifndef FONCTION_H
#define FONCTION_H
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#define RED_TEXT "\x1b[31m"
#define RESET_TEXT "\x1b[0m"
typedef struct{ // definition of a player for save the score
char name[50];
int score;
}Player;
typedef struct{ // definition of a table cell
int wall;
int target;
int robot;
}Cell;
void top10Score(int nb_players,Player *Playerss);
void writeBestScore(Player bestplayers[], int count);
int readBestScore(Player bestplayers[]);
void showPlayer(Player Playerss[], int n);
void fusionner(Player tab[], int debut,int milieu, int fin);
void triFusionRec(Player tab[],int debut,int fin);
void triFusion(Player tab[], int size);
void printMapRed(Cell ** map, int x, int y,int cible);
void addBorderWalls(Cell **map, int x,int y);
Cell ** generateMap(int *x, int *y);
int verifyTargetPlacement(Cell ** map, int xT, int yT);
void ** placeTargets(Cell ** map, int x, int y);
void placeAdditionalTerrainWalls(Cell ** map, int xMap, int yMap);
void placeWallsOnAnEdge(Cell ** map, int x, int y);
void placeRobots(Cell ** map, int x, int y);
int checkMove(Cell** map, char dir, int Posx, int Posy );
int findRobot(Cell ** map, int *x, int *y, int widthMap,int lenghtMap, int numrobot);
int moveInDirection(Cell** map, int lenghtMap,int widthMap, int targ,int numRobot);
int abandon(char a);
int moveTurn(Cell ** map, int targ, int lenghtMap, int widthMap, int numRobot );
int chrono(int a);
int harder();
int play(int nb_joueur, int *best,char **nom);
int gestionPoint(int nb_coup_prevu,int nb_coup_fait,int *tabScore,int player,int nb_joueur);
void showScore(int *tabScore, int nb_joueur,char **nom);
void finalMessage(char **nom, int *tabScore,int nb_joueur);
void game(int nb_joueur,int *tabScore,int nb_manche,char **nom);
void viderBuffer();
void move_cursor(int row, int col);
void move_cursor(int row, int col);
#endif