VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Tic Tac Toe that learns (True AI)

by JengHowe (1 Submission)
Category: Games
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (12 Votes)

A simple Tic Tac Toe game that allows you to play against the CPU. This Tic Tac Toe is different from others because the CPU 'learns' from its mistakes and will get smarter as you play more games with it. what makes the CPU 'smart' is actually a weight system which the CPU determines its best move by looking into history of games and determine which move would result in the lowest probability of losing. All the moves are stored in a history file and is loaded whenever the program starts. Initially when the history file is empty, the CPU is really dumb, but each time you win it, it will get smarter.
The initial history file included has all possible winning moves played out, so basically you cannot win the CPU no matter how hard you try. If you let CPU move first, it might win you if you are not careful! This is because the moves the CPU make is also derived from the move history, it choses the moves that yield the best winning chance. It will actually set traps to trap you if you are not careful! To make the CPU dumb again, just delete the "movhis.txt" file.
You can choose to go first or let the CPU go first. but the CPU only 'learns' when it is allowed to start second. The learning process might be a bit weird as the CPU will lose to the same tactic a few times, this is due to the weight decision process, but basically if you train it enough times, it will not lose again.
I rate this as a begineer because I only have less than 6 months VB programming experience. 3 months to be precise! Hopefully it will fit in to this category.
Comments and feedbacks are welcome. And Please rate my work!

Rate Tic Tac Toe that learns (True AI)

Download Tic Tac Toe that learns (True AI)

Download Tic Tac Toe that learns (True AI) (8 KB)

Tic Tac Toe that learns (True AI) Comments

No comments have been posted about Tic Tac Toe that learns (True AI). Why not be the first to post a comment about Tic Tac Toe that learns (True AI).

Post your comment

Subject:
Message:
0/1000 characters