Depends on what AI you want to make.
Quote:..... heuristic programming, which means that the program "learns" from previous experiences.
No, that's not right at all. Heuristic programming is when the AI uses heuristics to search. Heuristics are things that you know about the search that could make it easier for the AI to search: specific opening moves in chess games for example.
Genetic algorithm is very possible in QB. There are many versions of genetic algorithm, but this is the one that is easiest to implement (in QB):
[line number]: IF [some state] THEN {[GOTO [line number1]], [set some state 1]} ELSE {[GOTO [line number 2]], [set some state 2]}
You have N of these lines per "program", or you have a pool of common lines for all programs, or both.
Each "program" has a set of lines that it executes one after the other by following the GOTO rules, and when there is no GOTO in that line, it simply goes to the next line. You can give each program a line execution limit (ie: how many lines it can execute before the next program starts executing), or you can let each program run to the end of the last line. This is not recommended because you will end up with infinite loops.
You define a bunch of arrays for each program and the associated lines.
You also need to define what each possible input and output state is. You can also have intermediate steps. Example:
CONNECT 4
INPUT STATE:
byte string (or integer array) that determine the amount of chips in each column.
OUTPUT STATE:
one byte that says where to put the next chip.
There are many different ways to structure the input and output states as well as the array that will allow each "program" access. I like putting the input state, output state, and intermediate state(constant) in one big string, for instance:
110001110110011011 1111110101 101
input state, intermediate/constant state, output state
Each line accesses the values of strings of bits in the string to determine their T/F value. Then, the output state is read off the end and it's the next player's turn.
THEN, you need to figure out a way to recombine each program to make "new" programs. There are BILLIONS of ways to do this. For instance, you can get the top 50% programs and then you can randomly merge them with each other to create another 50% (while the bottom 50% are erased), leaving the initial top 50% intact. You can also have a merging pattern for each program which says what bits should be left behind and what bits should be copied over. You can also have it stay somewhat random and also depend on the relative wins for each program.
You can merge two programs at a time, three at a time, or you can merge each program with all the other programs. There are many ways to do it!
You REALLY need a CLEAR understanding of the input and output states and the FRAMEWORK of your program/game/puzzle/question to be able to do this correctly. STRUCTURE your output in SUCH A WAY so that the output is ALWAYS possible: for connect 4, for example, an output to a filled column should not be allowed.