Skip to content

SupercraftD/tic-tac-toe

Repository files navigation

Tic Tac Toe

A small project with a variety of bots to experiment with.

Made using p5.js and vite, all other code is original. None of the NPM dependencies are required to run the program. It's also available as one standalone html file in the releases.

Bots

  • Random: Chooses a random square to play in
  • D1: Will play in a square that lets them win, otherwise just does random
  • D2: Will play in a square that lets them win, and will block a square if it lets the opponent win.

UI

The radio buttons allow you to choose from two modes.

  1. Simulate Rounds will automatically simulate rounds between the two bots (1 round per frame)
  2. Manual, where you need to click for each play. In either case, the results of each round are shown right above the game, with the amount of wins and draws.

For each player, you can also choose what type of bot they use for their moves. You can switch these whenever you want, but it will cancel the current round if you switch mid-round.

Anyways, I just made this in like 2 hours. I hope it's fun at least a little bit. I might but probably won't add more bots.

About

Small tic tac toe project with a couple bot players to experiment with

Resources

License

Stars

Watchers

Forks

Packages

No packages published