Mobile Tic Tac Toe

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Mobile Tic Tac Toe

Using Android Studio, create an application to simulate tic tac toe. You will need to have a
game mode for standard (3x3), as well as 4x4 and 5x5.
Start off by making a welcome screen with a message of your choice. Use a hint to prompt the
user to enter a number between 3 and 5, and make sure to validate their input. If they enter an
invalid number let them know using a toast. Using their input, have a click listener on a button
below and have that take their input and direct them to the next activity.

There will be four total activities, the main screen, the standard tic tac toe, 4x4, and 5x5.
Using paint or another program generate three boxes of the same size, one with a border, another
with a border with an x, and the other with a border and an o. Put these into your resources
folder. These will be used to populate the ImageButtons on screen to show the user which
spaces are x, o or blank.
After you have your image buttons set up, create another class called Space. This class will do
most of the work. In space include an ImageButton, and three Booleans to determine if it is set
to x or y, and if it is set at all. In this class Also include a method to set to x and y (make sure to
change the image when you do so), and a method to check whether or not it is set.
In your Game screens you will mainly just be setting up the ImageButtons and the listeners for
them. Make sure to include some way to tell whose turn it is, and to check to see if the tiles are
set or not before you play.

You might also like