Project

Tic-Tac-Toe with AI (Java)

Hard
1639 completions
~ 24 hours
4.5

After finishing this project, you'll get to know a lot about planning and developing a complex program from scratch, using classes and methods, handling errors, and processing user input. You will also learn to use OOP (Object-Oriented Programming) in the process.

Provided by

JetBrains Academy JetBrains Academy

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!

Training project icon

Training project

This project allows you to practice and strengthen your coding skills, helping you get ready for more advanced tasks ahead.

What you'll learn

Once you choose a project, we'll provide you with a study plan that includes all the necessary topics from your course to get it built. Here’s what awaits you:
Create an easy difficulty level where the computer just makes random moves: simple to write and not too challenging to beat.
Choose whether you want to play with a friend or take a break and watch computers battle it out!
It's time to add a medium difficulty level. This AI should be a lot harder to beat! Are you up to the challenge?
Oh no, what have we created here? An unbeatable AI monster! Indeed, this complex algorithm guarantees a win or a draw.

Reviews

Trayana Boykova
1 week ago
During this project, I learned how to structure a complete interactive program, manage game logic, and implement different AI behaviors. The minimax algorithm was the most challenging part, especially understanding recursion and evaluating board states, but overcoming it helped me improve my problem ...
eser avatar
eser
2 months ago
The project is quite difficult but it is well worth one's time. I've learned a great deal about recursion. It is quite challenging to implement the recursive algorithm but working on it was immensely instructive.
Suryakumar Selvakumar avatar
Suryakumar Selvakumar
3 months ago
I have learned to use random numbers, loops, and recursion much better. A fun project

4.5

Learners who completed this project within the Java Desktop Application Developer course rated it as follows:
Usefulness
4.6
Fun
4.5
Clarity
4.5