Project: Tic-Tac-Toe with AI
About
Everybody remembers this paper-and-pencil game from childhood: Tic-Tac-Toe, also known as Noughts and crosses or Xs and Os. A single mistake usually costs you the game, but thankfully it is simple enough that most players discover the best strategy quickly. Let’s program Tic-Tac-Toe and get playing!
Learning outcomes
After finishing this project, you'll get to know a lot about planning and developing a complex program from scratch, using classes and functions, handling errors, and processing user input. You will also learn to use OOP (Object-Oriented Programming) in the process.
This project is a part of the following track
Python Developer
What you’ll do and what you’ll learn
Stage 1/5: Initial setup
Learn how to work with the field and the coordinates.
Stage 2/5: Easy does it
Make an easy difficulty level where the computer just makes random moves: simple to make and not too challenging to beat.
Stage 3/5: Watch 'em fight
Whether you want to play with a friend or take a break and watch computers battle it out, you can do both!
Stage 4/5: Signs of intelligence
Let’s create a medium difficulty level. This AI should be a lot harder to beat! Are you up to the challenge?
Stage 5/5: An undefeated champion
Oh no, what have we created here? An unbeatable AI monster! Indeed, this complex algorithm guarantees a win or a draw.