GitBit
Sign Up

Congrats!

You've unlocked an exclusive 25% discount on our Copilot course.

Use the code 25OFF at checkout to claim your discount. Don't miss out on this limited-time offer!

I created a tic-tac-toe game for my online casino using AI!

I wanted to add another game to my online casino Gcasino. So, I thought why not add tic-tac-toe? Of course, I won't be coding it, I'll be using Microsoft Copilot. Let's go!

Copilot playing Tic-Tac-Toe

I started simple with Please create a tic-tac-toe game using HTML, CSS, and JavaScript. I thought I'd ask for a generic site and then ask for more features. That was probably a mistake, and I'll explain what I plan to do next time at the end. Anyway, it pumped out some code and I tested it.

First thing I noticed, it wasn't actually putting an X or an O when I clicked. It did have logic on the backend because I saw the "X wins!" message. I noticed it forgot the CSS to put the X or O but I asked to see if Copilot could figure it out... It didn't. So, I told it what it was missing. I think we forgot the CSS to add the X or O. Can you add it please?

Once that was done the game was looking great. But currently, it's 2 players. I wanted the computer to be the other player. So, I simply asked. Please have the computer play O in tic-tac-toe for me please.

Of course, that added new issues. Now, when I click for X, then I click again it plays an O. Then the computer makes a move, and it adds another O making O go twice. It's messed up. I need to click and then the computer goes twice for o.

Then, I noticed I could go twice before the computer went so; I asked Copilot to disable my moves while it went. When I click to fast, it puts and O. Can you disable my click when it's O's turn?

After that there was another issue. I could put an X in a square where there was already an X. *Sigh* Can you disable the pointer cursor if there's already a move in the square, please?

Finally, after all of that we have our tic-tac-toe game. In reality it took me 10 minutes, but that's 8 more minutes then I originally planned to create the game!

All in all, it was a bit of a pain. I should have created a larger prompt to tell Copilot exactly what I wanted before we started. Something like "Please create a web-based tic-tac-toe game. The player will go first and play X. Then the computer will place an O. Please make sure to follow the rules of tic-tac-toe so I shouldn't be able to place an X before O is placed and I shouldn't be able to play an X if there's already a character in that box."

I think this exercise shows a couple of things.

  1. AI isn't going to replace developers any time soon. I needed to be able to code to tell Copilot it forgot the CSS to put the X and O in place.
  2. AI is really stronger when you ask it to "write tests for X code" or "Check for bugs in X code" or "How do I do X in JavaScript?"

I guess you could say I was ‘X-cited’ to add tic-tac-toe to Gcasino, but it turned out to be a real ‘O-verhaul’!

Did you like the site?