Java Bootcamp – Workbooks and Challenges
)}

Tic Tac Toe

This is the most exciting challenge in this course. You're going to build a two-player game of Tic Tac Toe!

Open the challenge

From Java Bootcamp Resources -> Module 1 -> 6. Array, open Challenge 6.

Task 1: Create an array


The Tic Tac Toe board is a grid with three rows.

Each row has three '_' characters. Your first task is to store these characters in an array.

Task 2: Print the array


Write a function that prints the board. Call the function after creating the board.

//Task 1: Create a board: char[][] board //Task 2: Call the function: printBoard(board);
/** * 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 */

Inside the function:

  • Print a new line.

  • add a tab of space before each row.
  • add a space after printing each character.

Good Luck!


Feedback Summary
4.8
39 students
5

92%
4

3%
3

0%
2

0%
1

5%
Written Reviews
There are no written reviews yet.