-
Notifications
You must be signed in to change notification settings - Fork 0
/
battleship.h
45 lines (36 loc) · 792 Bytes
/
battleship.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
/* FILE THAT CONTAINS THE INCLUDES,MACROS,STRUCTS AND FUNCTION PROTOTYPES TO THE BATTLESHIP GAME */
#ifndef BATTLESHIP_H
#define BATTLESHIP_H
//INCLUDES
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//MACROS
#define WATER '~'
#define HIT 'X'
#define MISS 'M'
#define SHIP 'O'
//STRUCTS
typedef enum
{
FALSE,
TRUE
} Boolean;
typedef struct ship
{
int hitpoints;
char *name;
char bitmap[5][5];
} Ship;
typedef struct cell
{
char symbol;
Ship *ship;
} Cell;
//PROTOTYPES
void startScreen(void);
void printShip(Ship *ship, int i);
void initializeShips(Ship *watership, int CARRIER, int BATTLESHIP, int CRUISER, int SUBMARINE, int DESTROYER, int T_SHIP, int NUM_SHIPS);
void rotateRight(Ship *ship, int i);
void rotateLeft(Ship *ship, int i);
#endif