Skip to content

JessieJolly/unbeatableTicTacToe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Unbeatable_TicTacToe

A tictactoe where you never win, implemented using minimax algorithm

Requirements

Make sure you have the pygame module along with Python. If not, use the package manager pip to install.

pip install pygame

Instructions

It is a two-player game between the user and the computer. The computer is made 'smart' using the minimax algorithm. This algorithm minimizes the chance of the user to win while simultaneously maximizing the chance of the computer to win. Hence the computer never loses no matter how hard the user tries.

*In the home-screen the user is free to chose either X or O

*The user can play the game any nummber of times using the re-play feature

*Each game ends in a draw or the computer wins

*User gets the first chance always

How to run

Copy the repo to your local device and simply execute the python file

python tictactoe.py

Screenshots

  1. Home Screen

image

  1. Game Board

image

  1. Winner Screen

image

Contribution

Jessica Jolly UwU

I'm just a beginner in programming, so I know there are better ways to implement some of these features. If you know an easier and more efficient way to do so, do let me know!