Add Ai logic and random drawing func

1Add Ai logic
2Add random drawing func