Tic Tac Toe Summary

Tic Tac Toe: Your Java Project. void main(String args[]) that reads in player inputs, process inputs, and prompt each round of the game or print the winner of the game. void printBoard(String[] curBoard) is a method to print the game board. int getComputerMove(String[] curBoard) randomly returns an available move for the computer. String getWinner(String[] curBoard) returns the winner of the game/TIE or '' if the game should continue.

Using Replit

Today you will be using Replit to learn how to code in Java. Before starting, you will need to sign up for a Replit account, if you do not yet have one.

Click the button below to sign up for a Replit account - you will need an email account in order to sign up. If you already have a Replit account, you can login to your account using the below button as well.

Sign up for Replit

Replit sign up form

Next, launch the Replit console we will use today by clicking the below button. You should see the screen below.

Launch Replit

The starting screen of a repl

We will now fork the Repl, which simply means to make a copy of the program, so that we can make our own changes to it. Click on the “Fork Repl” button on the top right, and then the “Fork Repl” button.

Forking a repl to make a copy of the program

After forking the Replit, you will see a window similar to the one below:

Replit window

Every time you see the “Launch Replit” button, you will need to follow the above steps to fork the repl in order to complete an activity. Ask for help if you are having trouble with forking the repls!

Before we start, let’s first understand how the window works. The file contains code, or instructions for the computer to run. By pressing the run button, you tell the computer to perform the instructions in the code. Any results from running the code will be displayed on the bottom screen, under the Console tab.

Click the icon next to the Run button that says open in Replit. This will be the window where you will type all the code for the TicTacToe program. Have fun!