Objects Lab: Tic Tac Toe Game: Spring 2025

03 Jan 2025 - 15:27 | Version 1 |

Learning Objective(s)

  1. Design and develop a program using objects
  2. Abstract i/o into only one class

Overview of the Program

Write a program to allow two users to play the game of Tic Tac Toe.

Specifics

  • No code or data files are provided for this lab
  • The main method should be found in a program called GameDriver
  • The game should be played in text mode
  • The actual game should be allowed to be created in three modes:
    1. Default size (3x3) that also gets the players' names
    2. A non default size that also gets the players' name. (The game should allow for different size boards, not just a 3x3)
    3. Getting the all the information for the previous option from a file. Format will be:
      • size (on a line by itself)
      • the name of the X player
      • the name of the O player
  • Only one class can do any direct I/O and it can't have any code that knows about the game. It can only do general type I/O
  • The grade will be partially based on the design of the classes
  • Classes should include any "helper" methods that are appropriate (even if not used in the game). This helps in testing and debugging

Phase 1

Design the program and develop a testing plan.
  • The design must include a complete UML diagram and should correctly include all major functions
  • The testing plan should included unit testing and integration testing
  • Submit a Software Design Report in only one pdf

Phase 2

Using your graded software design report
  • implement the program first for just a 3x3 game. Try to not hard code the number 3 into your operations. Only when that works with the issue with I/O and the need to load a game from a file should you try to expand your code to allow for an NxN game. Everything else will be worth many more points that what can be earned by allowing for an N x N game.
  • create a Software Development Report incorporating any necessary changes from the software design report. Be sure to include detailed instructions on how to run your program, including any instructions for extra credit.
    • include statement coverage (in additional to the unit testing and integration testing) in your testing report. If you create unit test programs, for unit testing you can just refer to each section in your report (no need to list input/output, but you must describe the purpose of each group of tests.
  • create a zip folder containing only the following (and submit it)
    • only one file (as a pdf) with the completed software development report
    • all the .java files needed to run the program
    • any input files you might want to have the grader use when running the program
    • any unit testing .java files

Optional improvements

Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor.
  • Allow for an AI player (only when it is a 3x3 game). Because of the limited options, you should hard code the program to play a perfect game
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine