I am getting more familiar with VBA and I am attempting to do a machine learning program for Tic Tac Toe. I don't want to just hard code the possibilities to win.
The best I have come up with for a machine learning program is to have a tree structure with all the possible moves that can be made, and then have the computer cut branches of the tree whenever it loses with that branch.
For example with the following way to denote where people have played, and the order the letters are written as the order the game has progressed
a|b|c
-----
d|e|f
-----
g|h|i
abdgfce - means the computer wins, a was played first, b second, d third....
I would like to have a data tree that looks like:
Level 0: a (Computer always starts with a)
Level 1: All the letters except a, as it has already been played
Level 2: For each letter in Level 0, all the letters except for the one right before it and a
And so on for all the levels of the tree until their are no more possible moves.
I tried looking for ways to implement this structure in VBA but the Microsoft website was of no help and the forums only speak of binary or sorting trees. Would somebody point me in the right direction or give me some pointers as to what I should try? What is a better way to solve this problem if this solution is not feasible?
Thank you,
Karim
