Lab 2: Project – Tic-Tac-Toe!

$24.99 $18.99

Aim: Write a program to handle the basics of a two-player game of Tic-Tac-Toe. Requirement: Design the project using OOP in Java! Let’s get started! Create a directory structure to hold your work for this course and all the subsequent labs: Suggestion: CS202/Lab2 Introduction Tic-tac-toe is a paper-&-pencil game for two players, X and O,…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)

Aim: Write a program to handle the basics of a two-player game of Tic-Tac-Toe.

Requirement: Design the project using OOP in Java!

Let’s get started!

    1. Create a directory structure to hold your work for this course and all the subsequent labs:

      • Suggestion: CS202/Lab2

Introduction

    1. Tic-tac-toe is a paper-&-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid.

  1. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the

game.

  1. The following example game is won by the second player, O:

Game Simplified:

  1. Need to design two versions of the game: Two players or Player Vs. Computer

    • The player always moves first and is X. The computer is O.

    • The only tricky part about the game is determining if a given person has won.

  1. Play continues until one player has scored three in a row or all squares have been filled with no winner.

  1. The players can play in only those squares that are not already occupied by either player.

    1. The program ends when the game is won by either player or the game is a draw.

Suggestions:

    1. Whenever/wherever possible, your program should have classes that imitate real world objects

  1. Interaction between classes should only occur using the methods!

  1. Use Scanner class to Input the user’s selection of letters.

  1. First get a simple two player version of your game correct!! Then try the Computer Vs. Player version.

  1. Your main function should be in the TicTacToe class

Submitting your work:

  1. All source files and class files as one tar-gzipped archive.

    • When unzipped, it should create a directory with your ID. Example: 2008CSB1001 (NO OTHER FORMAT IS ACCEPTABLE!!! Case sensitive!!!)

  1. Source files should include the following: (Case-Sensitive file names!!)

    • TicTacToe.java / .class

    • Any other supporting or required files

  1. Negative marks for any problems/errors in running your programs

  1. If any aspect of the game / rules are confusing, make an assumption and state it clearly in your README file!

  1. README file should also have instructions on how to use/run your program!

  1. Submit/Upload to Google Classroom

  1. Marks Allocation

    • 2-Player Version [10 points]

    • Computer vs. Player Version [10 points]

    • Coding Style [2 points]

    • README [3 points]

Lab 2: Project – Tic-Tac-Toe!
$24.99 $18.99