-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTicTacToe.java
More file actions
56 lines (41 loc) · 1.42 KB
/
TicTacToe.java
File metadata and controls
56 lines (41 loc) · 1.42 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
import java.util.Scanner;
public class TicTacToe {
// Function that takes a scanner, a board and either X or O ask for two numbers
// - row and column
// Function that checks to see if the three letters given all match
// puts letter in square (if not occupied)
// Print board
public static int num(Scanner scanner, String text) {
System.out.println(text);
int x = scanner.nextInt();
return x;
}
public static move(Scanner scanner, char[][] board) {
}
// Checks if there is a letter in the space vv
public static boolean checkXorO(int space1, int space2, char[][] board) {
if (board[space1][space2] == 'X' || board[space1][space2] == 'O') {
return true;
System.out.println("There is an X or O in this space, select another spot.")
}
else{
return false;
System.out.println("There is no X or O in this space.")
}
}
// Put letter in square!!!
public static boolean allsame(char[][] board) {
}
// Function that checks a board to see if it has three in row vv (add to it)
public static boolean threerow(char [][] board) {
if (board )
}
// Board!! vv
public static void main(String args) {
char[][] board = new char[][] {
new char[3],
new char[3],
new char[3]
};
}
}