Tic Tac Toe

We're gonna continue on our `Tic Tac Toe` game developed from last semester. This is a two-player game where each player takes turns to mark a square on a 3x3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row wins the game. Tic Tac Toe

This time, we're gonna make some adjustments so that human players can play against the computer.

Starter Code

Click to view or download the starter code for this project.

Code Refactor

Code refactoring is the process of restructuring existing code without changing its external behavior or functionality. It improves the internal structure, readability, and maintainability of the code, making it easier to understand, debug, and extend in the future.

Common Refactoring Techniques

Task

We're going separate the starter code run.py into multiple files: Here's what your main.py should look like after refactoring: Please finish the rest of files

Complete Refactored Source Code

Player vs. Computer

To make the game more interesting, we're gonna add a computer player that can play against the human player. The computer player will make its move based on a simple algorithm that you will implement.

Computer Strategies

We've disucssed several strategies that the computer can use to make its move: Please find the source code here:

Nov. 24, 2024

We have no class next week. Have a good Holiday!!
We're done with Winning Move on the class, please find the src code above and try to implement the Blocking Move on your own.

End of Year Assignment

Dec. 15, 2024

No class next two weeks, we'll resume on Jan. 4th, 2025

We've talked about game menu screen this weekend. Basically, your game should have two views

Menu Mode allows user to select among the three levels, namely Easy, Hard and Pro

Game Mode is where the game is played. The computer player will make its move based on the selected level.

Please find the latest source code here:

Homework

Try to complete the game on your own during the break.

We'll discuss the solution on Jan. 4th, 2025.

Here's a demo of a finished game

Tic Tac Toe

Class Meet 01/04/2025

We've compleleted the following on class: Please find out the lastest src code here Homework

Jan 11, 2025

Please find the Homework here
Class Announcement
See you on Feb 8, 2025!