Please just stick with one thread. Delete this or ask a moderator to combine it with your other inquiry.
As for whether your AI code is correct or not, you could try reading it, it's just code. You could try compiling it, it's just code. You could try running it, you know, it is just code.
a7