Solution Review: Task I to III
Let's look at the solution to the tasks from the previous lesson.
Task I: Create a Tic-tac-toe board
The task was to create a 3x3 array to represent the Tic-tac-toe board.
Let’s review the solution for this task in the code playground below:
Press + to interact
class Main {public static void main(String[] args) {//Let's create a 3x3 character array that represents our tic tac toe boardchar[][] game_board = new char[3][3];}}
- Line 6: We create a 2D array named
game_board
that has3
rows (the first square bracket) and3
columns (the second square bracket).
We’ve ...