How do I alternate between X and O

Based on the post title, I think there is a better than reasonable chance the answer will be:
image

But you will need to follow OrbitalZones’ advice for better help, we have no idea what you are trying to do here.