Jump to content

🕹 So, I asked ChatGPT-4 to write a Tic-Tac-Toe game ...


Recommended Posts

I'll not bore you with all of the HTML and Javascript code that GPT-4 produced, but suffice to say that I asked it to produce a basic Tic-Tac-Toe game where the AI plays using the MiniMax Algorithm (Google it! All games coders should know this algorithm). The result was, as far as I can ascertain, a game that can only be lost or drawn by a human player.

 

Check it out here if you're interested ... https://webtrek.co.uk/oxo_minimax.html

 

Screenshot ...

 

2023-06-03_13-01-12.jpg.0cb5e580f0cc7ae57081796b573ed288.jpg

 

It must be said though, that while the AI produced some good code, it wasn't perfect at first and involved me adding further prompts based on my own coding experience to get it to modify the code. It got there in the end though and none of the code has been written by me.

 

The idea that everyone and their Granny will be able to code games though is a long, long way in the future! 🤣

 

 

 

Link to comment
Share on other sites

Sorry! couldn't help tweaking it myself a bit by adding a background image  to the board. I altered the colour of the AI pieces to yellow and added a drop shadow too.

 

2023-06-03_15-16-45.jpg.a4475ffaf06922d7996c870cb92a54d4.jpg

 

 

Pretty boring game though when you can never win! 😳

 

 

 

Edited by webtrekker
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...