-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.h
43 lines (32 loc) · 890 Bytes
/
util.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
/**
* @file util.h
* @author Vincent Li
* Provides constants/values/functions shared by multiple files.
*/
#pragma once
#ifndef UTIL
#define UTIL
#include <string>
#define row first
#define column second
#define moveRCPair std::pair<int,int>
// Details of player X
const int PLAYER_X_CODE = 1;
const std::string PLAYER_X_NAME = "Player X";
const char PLAYER_X_MARK = 'X';
// Details of player O
const int PLAYER_O_CODE = -1;
const std::string PLAYER_O_NAME = "Player O";
const char PLAYER_O_MARK = 'O';
// Placeholder for an empty box in the board
const char CLEAR = '_';
// Blank board
#define BLANK_BOARD {{CLEAR, CLEAR, CLEAR}, {CLEAR, CLEAR, CLEAR}, {CLEAR, CLEAR, CLEAR}}
const int ROWS = 3;
const int COLS = 3;
const int PLAYER_O_WON = PLAYER_O_CODE;
const int PLAYER_X_WON = PLAYER_X_CODE;
const int WIN = 1;
const int LOSS = -1;
const int DRAW = 0;
#endif // UTIL