I built the logic of my tic tac toe game in VS Code and I built the GUI in intellij using swing.
The purpose of this program was to challenge myself and diversify my programming knowledge. I believe that I am comfotable coding logic, however, I did not know how to code any graphics which interested me. I began watching a tutorial to teach myself how to program a GUI.
I ran into many problems while creating the logic section of my tic tac toe game. The first problem I ran into was setting up the board. I had the idea to create a char array in order to do so and then pull each element from the array and print it in a loop. The next issue I had was printing out the moves that each player makes. I realized that if I created if statements for each move that could be made then I could create a similar for loop as I did when I print the gameboard. The last issue I ran into was breaking the loop for the amount of moves made. I noticed that player one (x) was getting 5 moves and so was player 2 (o). I realized that I needed to create an if statement where if the loop gets to 4 for player 2 (o) then the program would stop. The allowed player 2 (o) to only have four moves that it could make.
I ran into many problems while creating the GUI for my game. My initial problem was that I did not know swing so I had to watch a video that taught me how to use swing. I learned about how to use a panel container, JFrames, JButtons, action listeners and more. Moreover, I learned how to use many other swing properties in order to create the GUI.
I realized that I need to spend more time learning how to use swing in order to create GUI's in the future. My takeaway is to watch a youtube tutorial that breaks down how to use swing and then I will implement what I learn in my next prograaming project. I believe this is a great step to diversify my knowledge in not only Java but also programming.