-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTicTacToe.java
91 lines (82 loc) · 2.32 KB
/
TicTacToe.java
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
public class TicTacToe {
public static void main(String[] args) {
// Crea aquí la lógica de tu programa, y ejecuta cuando requieras los métodos
// que has de desarrollar basándote en la documentación (docComments)
}
/**
* Function name: printBoard
*
* @param board (char[][])
*
* Inside the function:
* 1. print a new line.
* 2. print the board.
* • separate each row by two lines.
* • each row precedes a tab of space
* • each character in the grid has one space from the other
* character
*/
/**
* Function name: askUser
*
* @param board (char[][])
* @return spot (int[])
*
* Inside the function
* 1. Asks the user: - pick a row and column number:
* 2. Check if the spot is taken. If so, let the user choose again.
* 3. Return the row and column in an int[] array.
*/
/**
* Function name: checkWin
*
* @param board (char[][])
* @return count (int)
*
* Inside the function:
* 1. Call checkRows
* 2. Call checkColumns
* 3. Call checkLeft
* 4. Call checkRight
* 5. If count is 3 or -3 return count
*/
/**
* Function name: checkRows
*
* @param board (char[][])
* @return count (int)
*
* Inside the function:
* 1. Make a count variable that starts at 0.
* 2. Check every row for a straight X or straight O
*/
/**
* Function name: checkColumns
*
* @param board (char[][])
* @return count (int)
*
* Inside the function:
* 1. Make a count variable that starts at 0.
* 2. Check every column for a straight X or straight O
*/
/**
* Function name: checkLeft
*
* @param board (char[][])
* @return count (int)
*
* Inside the function:
* 1. Make a count variable that starts at 0.
* 2. Check the left diagonal for a straight X or straight O
*/
/**
* Function name: checkRight
*
* @param board (char[][])
* @return count
* Inside the function:
* 1. Make a count variable that starts at 0.
* 2. Check the right diagonal for a straight X or straight O
*/
}