CS 142 Lab 2
Tic Tac Toe
In this lab, you will play and modify a game already written for you in Java. Through playing the game and investigating the code, you will practice with using functions, Java objects, calling instance methods, and multidimensional arrays.
Getting started
Start IntelliJ. Follow the instructions (from class/the webpage on January 12th) for pulling the latest version of the in-class code using Git. You’ll create a project using the same link from last week: https://github.com/ncp38/cs142-s24-inclass
In the left-hand panel, expand the
src
folder to see today’s lab (in thelab3
folder). Double-click onTicTacToe
(not themd
file yet.) If you get a yellow bar at the top that says “Project JDK is not defined,” then click on “Setup SDK” and choose the JDK you downloaded earlier.In the left-hand panel, double-click on
TicTacToe.md
. Follow the instructions in this file. This is where you will answer the questions for the lab.
Note: You do not need to open the SimpleCanvas
file.
Submitting the lab
When you are done, please turn in the TicTacToe.java
file and the TicTacToe.md
file to canvas.
-Each Java file you upload should include a header with an assignment title, your name, class number/period, and any teammates’ names. (Your names need to be listed in the questions.md file as well!)
-Beneath this header include a short description of what you’ve changed in the file.
For example:
//Lab 2 - Tic Tac Toe
//John Doe, COMP 142 Section 1
//Jane Deere, COMP 142 Section 1
//Changed lines 180-235 to allow three player games on different-sized boards.