Hey Arduino forum,
As my first major Arduino project i am making a Tic Tac Toe game that allows the player to play against an AI. I'm using the mega 2560 with an Adafruit LCD tft shield. I have very little experience coding, and using functions. Currently i have written the code for a person to play against the computer who will randomly select an available section of the grid unless, A. The user has 2 pieces in a row or, B. The computer has two pieces in a row. While the code sorta works, i know with my insane amount of if statements that i am not writing the code nearly as efficiently or well as i could be, I will attach my code on to this post. Thanks very much, any suggestions would be greatly appreciated.
Also i am very sorry if this is the wrong place to post this type of question, if this is the case could you guys please direct me towards where it should be.
PrototypeDefAttack.ino (27.8 KB)