-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConstants.java
More file actions
57 lines (53 loc) · 1.57 KB
/
Constants.java
File metadata and controls
57 lines (53 loc) · 1.57 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
/**
* Contains all the constants needed among all classes.
*/
public class Constants {
/**
* These definitions are used in the contents of squares in TTTBoard.
* the CELL_X and CELL_O constants are also used to refer
* to this and the other player
*/
public static final int CELL_EMPTY = 0; ///< the cell is empty
public static final int CELL_X = 1; ///< the cell belongs to the X player
public static final int CELL_O = 2; ///< the cell belongs to the O player
public static final int CELL_INVALID = 3; ///< the cell is invalid
/**
* A simple way of representing the pieces of the board.
*/
public static final String[] SIMPLE_TEXT = {
". ", // CELL_EMPTY
"x ", // CELL_X
"o ", // CELL_O
" ", // CELL_INVALID
};
/**
* A more sophisticated way of representing the pieces of the board, using
* the Unicode character set.
*/
public static final String[] UNICODE_TEXT = {
"― ", // CELL_EMPTY
"✗ ", // CELL_X
"𝑂 ", // CELL_O
" ", // CELL_INVALID
};
/**
* A quite sophisticated way of representing the pieces of the board, using
* the Unicode character set with colors.
*/
public
static final String[] COLOR_TEXT = {
"\u001B[30m― \u001B[0m", // CELL_EMPTY
"✗ ", // CELL_X
"𝑂 ", // CELL_O
" ", // CELL_INVALID
};
/**
* Symbols used for messages between clients.
*/
public static final char[] MESSAGE_SYMBOLS = {
'.', // CELL_EMPTY
'x', // CELL_X
'o', // CELL_O
'_', // CELL_INVALID
};
}