Advertisement
Guest User

kood

a guest
Sep 22nd, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. package tripstrapstrull;
  2. import java.util.Scanner;
  3.  
  4. public class TicTacToe {
  5.     public static void main(String[] args) {
  6.          char[][] board = {{'1','2','3'}, {'4','5','6'}, {'7', '8', '9'}};
  7.          
  8.          char player = 'X';
  9.          char comp = 'O';
  10.          Scanner input = new Scanner(System.in);
  11.          displayBoard(board);
  12.     }
  13.    
  14.          
  15.     public static void displayBoard(char[][] board) {
  16.         System.out.println("+---+---+---+");
  17.         System.out.println("|" + board[0][0] + "  | " + board[0][1] + " | " + board[0][2] + " |  " + "\n+---+---+---+");
  18.         System.out.println("|" + board[1][0] + "  | " + board[1][1] + " | " + board[1][2] + " |  " + "\n+---+---+---+");
  19.         System.out.println("|" + board[2][0] + "  | " + board[2][1] + " | " + board[2][2] + " |  " + "\n+---+---+---+");
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement