Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tripstrapstrull;
- import java.util.Scanner;
- public class TicTacToe {
- public static void main(String[] args) {
- char[][] board = {{'1','2','3'}, {'4','5','6'}, {'7', '8', '9'}};
- char player = 'X';
- char comp = 'O';
- Scanner input = new Scanner(System.in);
- displayBoard(board);
- }
- public static void displayBoard(char[][] board) {
- System.out.println("+---+---+---+");
- System.out.println("|" + board[0][0] + " | " + board[0][1] + " | " + board[0][2] + " | " + "\n+---+---+---+");
- System.out.println("|" + board[1][0] + " | " + board[1][1] + " | " + board[1][2] + " | " + "\n+---+---+---+");
- System.out.println("|" + board[2][0] + " | " + board[2][1] + " | " + board[2][2] + " | " + "\n+---+---+---+");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement