For more information or access to these projects, please visit my GitHub account in the Contact page.
The idea for this project came to me one day when I was watching my little brothers play tic-tac-toe at the house. I thought to myself how could I create a more entertaining way to play tic-tac-toe? As a result, I created an Android application with a simple GUI that contained three playable versions of tic-tac-toe with support for landscape and portrait orientations, and used saved preferences to keep track of light/dark modes for a more user-customized experience.
The application contained a ViewModel that contained the information on the game mode selected and the boards used to make sure that the UI could find their references during screen rotation or other life-cycle ‘inducing’ events. In addition, the application consisted of many fragments to display the different aspects of the app such as the title screen, the display of the single tic-tac-toe board, and the display of the triple tic-tac-toe boards.
In terms of implementing the logic behind the game, a custom data type named TicTacToeBoard represented a tic-tac-toe board and a custom data type named GameSymbol represented the player symbols. Inside of the tic-tac-toe data type was an encapsulated 2D array that represented the abstract dimensions of the board and the methods for adding the entries and checking to see if there was a three-in-a-row.
In terms of the visuals for the game modes, the board layouts consisted of a Table with TextViews that updated upon clicking to the right symbol. For the triple board game mode, a RecyclerView displayed the list of the boards to conserve memory.
The idea for my Barbell Weight Calculator came to me one day when I was lifting weights at my college gym. After setting a personal record on the bench press, I wanted to calculate exactly how much weight I had just benched. As a result, I developed an application that not only calculated lifts, but also calculated the possible weight combinations required to reach a specific lift target. In addition to calculating these weights, I also developed an Android Room Database that allowed for storing the calculated lifts.
The application contained ViewModels that conducted the calculations and stored the database entries so that the UI could find their references during screen rotation or other life-cycle ‘inducing’ events. As mentioned earlier, the application also contained a Room Database that stored the user’s custom workouts and their exercises. In addition, the application consisted of many fragments to display the different aspects of the app such as the title screen, the display of the calculations, and the display of the workouts and their exercises.
Two custom data types were implemented in order to properly display and save the weight calculations. The first data type implemented was an Exercise data type that stored the name of the exercise, the weight combination associated with it, a boolean that indicated whether the weight of the bar was included in the calculation or not, the weight of the total lift, and the weight of the bar used in the lift. The second data type implemented was a Workout data type that stored the name of the workout and the list of exercises associated with the workout.
In order to calculate every possible weight combination for a certain lift weight, a combination algorithm I had implemented prior to the project was used to go through every possible combination of the list of weights that equaled the targeted lift weight. The algorithm incorporated the use of recursion to reduce the weight list in order to go through every element of the weight list. The algorithm also had to incorporate a restriction array that kept track of the number of weights that were allowed to be used in the combinations based on user input from the calculation component of the application.