During this project, I made a player game where the players have to compete to be the last one standing from either attacking to lower a random player's health, or sleeping to gain health.
So the project starts with the computer asking for the names of the players. Once the players are done putting names, they can type done. Then, the computer will ask each player to either attack or sleep. Each player takes turn making their choice. If the player attacks, a random player will be attacked and they will lose some health. If they choose sleep, then they will gain some health. The cycle continues until there is one last player standing.
Overall, this project helped me with my communication skills and debugging, allowing me how to ask for assistance if I have any trouble and how to fix on my code if my project doesn't work.
One of the challenges was that there was some sort of error when one player reached to health 0. It was supposed to delete the player from the ArrayList, but it didn't work. So, I asked one of my classmates for some help by showing one part of my code and asking if there is any sort of error. Turns out, I put the wrong letter variable when I made the code to remove the player. The for loop uses the letter "r". I used "i". So, I changed the "i" to an "r", and it worked!
If I could do this project differently, I would add comments so I know what I am doing with my code and what the code tells about.
Preview