-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
34 lines (28 loc) · 961 Bytes
/
Main.java
File metadata and controls
34 lines (28 loc) · 961 Bytes
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
import java.util.Scanner;
public class Main {
private Player player;
public void setPlyaer(Player player){
this.player = player;
}
public static void main(String[] args){
System.out.println("Enter the size of your board:");
Scanner sc = new Scanner(System.in);
int size = sc.nextInt();
System.out.println("Which way you wanna play, you dig? [1] human & human [2] human & computer [3] computer & computer");
int choice = sc.nextInt();
TicTacToeGame game = new TicTacToeGame(size, choice);
System.out.println("Board in the beginning:");
game.printBoardNxN();
while (true) {
game.firstPlays();
if (game.checkWinner())
break;
game.printBoardNxN();
game.secondPlays();
if (game.checkWinner())
break;
game.printBoardNxN();
}
sc.close();
}
}