Skip to content
Sign upLog in

⭕❌ Noughts And Crosses ONLINE ❌⭕

Profile icon

⭕❌ Noughts And Crosses ONLINE ❌⭕

An offline and online game created using Python and Pymongo

What is this?

This is a noughts and crosses game made using Python.
There are 3 gamemodes:

  • Play against the computer (offline)
  • Play against a friend (offline)
  • Play against someone online (online)

More information about each of these gamemodes will be explained later in this post.

Note that noughts are always first

How do I play Noughts And Crosses?

Have you been living under a rock? xD

The definition from Google is this:
Tic-tac-toe, noughts and crosses, or Xs and Os, is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.

In other terms, you and another person take alternate goes to place either a naught or a cross. Once you have placed your counter, it cannot be changed until the end of the game where the board is wiped clean.
The winner is the first person who places three of their counters in a row either horizontally, vertically or diagonally.

What does "Play against the computer" mean?

This gamemode is a human vs a computer.
You will choose where you go and then the computer will decide where to go.

🙏 At the moment, the computer takes a random guess and so it's moves aren't calculated. If you would like to have an easy, medium, hard etc mode then please upvote and comment 😄 🙏

What does "Play against a friend" mean?

This gamemode is a human vs a human.
So it doesn't have to be a friend 🔥🔥🔥 if you don't have any 🔥🔥🔥

🙏 Please comment any features that you would like to see in this gamemode! 🙏

What does "Play against someone online" mean?

This gamemode is a human vs a human but they don't have to be at the same computer.
This was only made possible using MongoDB which I love 🥰🥰🥰

🙏 Again, please comment any features that should be in this gamemode! 🙏

Planned features

  • Global leaderboard
  • See anybody else's stats
  • Background timer so that you don't wait forever for someone to join that game xD
  • Ability to see and change account settings

That's all for now, I can make a tutorial if you would like to know how to make "online" games using Pymongo.
I use Pymongo to stimulate an online presence but all that happens is that it makes several calls to an online database and trades data.

I have been working on this online mode for a while now, so an upvote would be awesome!

Please inform me of any errors that you find, I've spent a few hours trying to eradicate them 😅


Ping me on repl discord @Zeliktric and if I respond then I will play with you 🙃


for beating me xD

You are viewing a single comment. View All
Profile icon

pretty cool!

you might want to change the computer mode tho; sometimes the computer selects a position that isn't blank, this randomness, instead of strategy makes the player almost always win lol

for example why did the computer choose position B2 lol?

Screen Shot 2020-10-10 at 6.41.22 PM

but other than that pretty cool! :)

Profile icon

Yeah there isn't an algorithm at the moment :)

Profile icon

oh ok lol, good luck! :)