0% found this document useful (0 votes)
7 views10 pages

Python Tic-Tac-Toe Project Overview

The document outlines a project for creating a Tic-Tac-Toe game using Python and Linux, presented by students at the East West Institute of Technology. It details the game mechanics, board setup, player input validation, winning conditions, and AI opponent strategies. Additionally, it includes a project evaluation rubric for assessing teamwork, technical knowledge, presentation, and report submission.

Uploaded by

crazydeep111
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views10 pages

Python Tic-Tac-Toe Project Overview

The document outlines a project for creating a Tic-Tac-Toe game using Python and Linux, presented by students at the East West Institute of Technology. It details the game mechanics, board setup, player input validation, winning conditions, and AI opponent strategies. Additionally, it includes a project evaluation rubric for assessing teamwork, technical knowledge, presentation, and report submission.

Uploaded by

crazydeep111
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

EAST WEST INSTITUTE OF TECHNOLOGY

(NAAC ACCREDITED, AUTONOMOUS INSTITUTION AFFILIATED TO VTU, BELGAVI AND RECOGNIZED BY THE AICTE, NEW
DELHI)

SRI RAVIKIRAN CENTER OF EXCELLENCE PROGRAM


PYTHON PROGRAMMING WITH LINUX
DEPARTMENT OF INTERNET OF THINGS (IC)& ENGINEERING

1ST SEMESTER

2024-2025

PROJECT NAME: TIC TAC TOE USING LINUX [PYTHON] PRESENTED BY:

MENTOR NAME: SRINIVAS SIR 1. MANOJ.H.S-1EW24IC020


2. MOHAMMED NAWAZ(CR)-1EW24IC021
3. DHANUSH-1EW24IC011
4. DEEPAK.B.M-1EW24IC009
XOX: A Python
Implementation of Tic-
Tac-Toe
This presentation explores the creation of a Tic-Tac-Toe game in
Python. We will delve into game mechanics, board setup, player
input, and winning conditions. Additionally, an AI opponent's
strategy and code will be covered.
Game Design and Core Mechanics
Game Rules Board Design

Tic-Tac-Toe involves two players. Players alternate The game board is represented as a 3x3 matrix. Each
marking spaces in a 3x3 grid. The goal is to get three in cell can be empty, X, or O. Simple data structures are
a row. easy to start with.
Setting Up the Game Board

Initialize Board Display Board Board Representation


Create a 3x3 matrix. Fill it with empty Print the board to the console. Show Use a list of lists. Each inner list is a row.
spaces. Empty can be a hyphen symbol: - current state clearly. This is easy to debug. This allows easy access and updates.

def create_board():
board = [['-' for _ in range(3)] for _ in range(3)]
return board
Player Input and Move
Validation
Get Input Validate Move
Prompt players for their Check if the chosen cell is
move. Ask row and column empty. Also verify the
numbers. These are row/column are in bounds.
numbers from zero to two. Reject any invalid move.

Update Board
If move is valid, update the board. Place the player's symbol.
Example: X or O symbol
Winning Logic and Condition Checking

Check Columns
2
See if any column has three matching symbols.

Check Rows 1
See if any row has three matching symbols.

Check Diagonals

3 See if either diagonal has three matching symbols.

def check_win(board, player):


for row in board:
if all(cell == player for cell in row):
return True
# Add column and diagonal checks here
return False
AI Opponent Strategy
and Implementation
1 Easy AI 2 Medium AI
Choose a random Block player wins. Choose
available cell. center if available.

3 Hard AI
Use Minimax algorithm. Ensure perfect play.
Error Handling and
Edge Cases

Invalid Input Full Board Out of Bounds


Handle non-numeric Detect a draw when Handle indices
input. Reject board is full. outside the board.
strings. Show an Announce the tie Prompt again.
error message. game.
Code Demonstration and Live
Walkthrough
This section will show the Python code. The full game implementation will be
demonstrated. A live walkthrough will explain key parts.

# Complete Tic-Tac-Toe code in Python


# (Combined code from previous slides)
def create_board():
board = [['-' for _ in range(3)] for _ in range(3)]
return board

def display_board(board):
for row in board:
print(" ".join(row))

# Add the rest of the code here: input, validation, win checking,
AI
# ...

board = create_board()
display_board(board)
EAST WEST INSTITUTE OF TECHNOLOGY
(NAAC ACCREDITED, AUTONOMOUS INSTITUTION AFFILIATED TO VTU, BELGAVI AND RECOGNIZED BY THE AICTE, NEW
DELHI)
SRI RAVIKIRAN CENTER OF EXCELLENCE PROGRAM
PROJECT PRESTION EVALUATION
Maximum Marks:20
Level Of Achievement
[Link] CRITERIA Excellent(5) Good(4) Average(3) Poor(2) Score
1 TEAM WORK(5)
2 TECHNICAL KNOWLEGDE(5)
3 PRESENTATION(5)
4 REPORT SUBMISSION(5)
TOTALMARKS

STUDENT NAME USN SIGNATURE


DHANUSH.K 1EW24IC011
MOHAMMED NAWAZ 1EW24IC021
DEEPAK.B.M 1EW24IC009
MANOJ.H.S 1EW24IC020 SME Signature

You might also like