Posted 13 September 2012 - 11:57 PM
How do I compare two table's values? I need to compare two tables to see if a pattern emerges. Like this:
{1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 6} It would need to see {1, 2, 3, 4} occurred x number of times, and 5 came after that pattern the most. So it would predict 5 comes after that this time. How do I compare {1, 2, 3, 4} to the longer table though, to get that pattern?
In case you are wondering what for, it's to make an AI. Cranium, if you are reading this: Challenge Accepted.
…..Just as soon as I can do this…
{1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 6} It would need to see {1, 2, 3, 4} occurred x number of times, and 5 came after that pattern the most. So it would predict 5 comes after that this time. How do I compare {1, 2, 3, 4} to the longer table though, to get that pattern?
In case you are wondering what for, it's to make an AI. Cranium, if you are reading this: Challenge Accepted.
…..Just as soon as I can do this…