This homework is designed to give students the opportunity to complete the Tic-Tac-Toe game in a Unix
environment. This homework also explores the check1302
program that helps students check their code
style. At the end of the assignment, students will have an opportunity to submit an assignment on Odin
for the first time.
- An understanding of classes, objects, and 2-D arrays in the Java programming language.
-
Log into your Odin account. You should not use an IDE to complete this homework. Instead, you are expected to use Odin and Emacs.
-
Complete the Recommended Emacs Configurations section of the CSCI 1302 Style Guide (more details soon).
-
Use Git to clone the repository for this exercise onto Odin into a subdirectory called
cs1302-hw0.5
using the following command (remember not to type the$
as that represents our prompt):$ git clone --depth 1 https://github.com/cs1302uga/cs1302-hw0.5.git
- Change into the
cs1302-hw0.5
directory and type thetree
command. You should see three familiar files under thesrc
directory. This is the same code you downloaded and completed in the previous homework assignment. - Without changing directories, open the
TicTacToeGame.java
file using Emacs. Take a minute to look through the file. You should recognize this as the original file without any of the modifications you made last week. - Take a moment to think about the process of downloading this code from GitHub (you just typed a single command) and compare that process to what you had to do to get started last week (saving the file to your hard drive, locating your favorite IDE, creating a project in your IDE, importing the code, etc.).
- Now that we've got our environment set up, we want you to complete
TicTacToeGame.java
on Odin using Emacs. Please do this without copying and pasting your code from an IDE. The purpose of this part of the exercise is for you to get practice with Emacs. It may feel slow and error-prone at first. However, you will get much faster over time. Note: You should have already implemented these methods (if you haven't, please go back to the first part of this assignment). - Once your code is completed, exit the Emacs text editor. You should still be in the
cs1302-hw0.5
diretory. - Create a new folder called
bin
directly within thecs1302-hw0.5
directory. - Compile the three Java files located in the
src
directory - placing the byte code (.class
) files in thebin
directory (remember, compilation order matters!). Also, don't forget to use the-d
command-line option when compiling.- Note that the Java files are not in a named package. For this homework, compiling to the default package is okay.
- If you have any syntax errors, note where the error occurs, go back into
TicTacToeGame.java
and fix the errors. - Once your code compiles, run the
TicTacToeTester
class and make sure it passes all tests. If not, fix the bugs in the code before proceeding. - Once the
TicTacToeTester
passes all of the provided tests, run theTicTacToeRunner
and play a few games of Tic-Tac-Toe keeping an eye out for any bugs that may not have been caught by the tester. If you're confident that your code is working, proceed to the next checkpoint.
-
In this checkpoint, we want to make sure our code is readable and follows the course style guidelines which are described in the 1302 Style Guide.
-
Take a few minutes to read up to the "Recommended Emacs Configurations" section of the style guide, which explains the motivation behind having good code style.
-
Run the
check1302
command on yoursrc
directory to see if you have any style errors.- If
check1302
reports a Missing Javadoc Error, you should add a Javadoc comment to the method it highlights. Since we haven’t officially covered Javadoc comments in the course yet, please use the existing methods inTicTacToeGame.java
that have valid Javadoc comments as examples. If you have any questions about the syntax or what should be included, don't hesitate to ask.
- If
-
If you receive any style errors, you can find a description of the error along with what causes the error in the Specific Guidelines section of the guide. There is no need to memorize the different types of errors. You will have access to the guide when coding in this course.
-
When there are no more style errors, you should see the following output after running
check1302
on your code:Starting audit... Audit done.
-
Congratulations on a nice, working Tic-Tac-Toe game written on Unix with good code style! You're now ready to submit the application.
Each student needs to individually submit their own work.
-
Create a plain text file called
SUBMISSION.md
directly inside thecs1302-hw0.5
directory with your name and UGA ID number.Here is an example of the contents of
SUBMISSION.md
.Sally Smith (811-000-999)
-
Change directories to the parent of
cs1302-hw0.5
(e.g.,cd ..
fromcs1302-hw0.5
). -
Use the
submit
command to submit this exercise tocsci-1302
:$ submit cs1302-hw0.5 csci-1302
Read the output of the submit command very carefully. If there is an error while submitting, then it will displayed in that output. Additionally, if successful, the submit command creates a new receipt file in the directory you submitted. The receipt file begins with rec and contains a detailed list of all files that were successfully submitted. Look through the contents of the rec file and always remember to keep that file in case there is an issue with your submission.
Note: You must be on Odin to submit.
Copyright © Michael E. Cotterell, Brad Barnes, and the University of Georgia. This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License to students and the public. The content and opinions expressed on this Web page do not necessarily reflect the views of nor are they endorsed by the University of Georgia or the University System of Georgia.