Skip to content

Latest commit

 

History

History
62 lines (37 loc) · 6.61 KB

W16_lab05.md

File metadata and controls

62 lines (37 loc) · 6.61 KB

Nicole Moghaddas (nicolemoghaddas) & Laura Anthony (lanthony159)

(a) This project includes 2 pokemon-themed subgames: tic-tac-toe and rock-paper-scissors. Tic-tac-toe is a two player game, and rock-paper-scissors is played against the computer.

(b) 1. As a player, I can click on one of two options (Tick Tac Toe or Rock Paper Scissors), so that I can select which game I want to play.

2. As a player of tic tac toe, I can click on one of three characters (Charmander, Bulbasaur, Squirtle), so that I can choose my character for the game.

3. As the first player of tic tac toe, I can click on any one of 9 boxes, so that I can begin the game against the second player.

4.  As the second player of tic tac toe, I can click on any one of the boxes remaining after the first player chooses, so that I can place my game piece.

5. As a player of tic tac toe, I can click on the "Ok!" button, so that I can accept notification of who won the game.

6. As a player, I can select the "Go Back to Game Selection" button, so that I can switch games after one is done or if I want to end the current game.

7. As a player of rock paper scissors, I can choose one of three rock paper scissor options, so that I can send my option to the computer opponent.

8. As a player of rock paper scissors, I can view wins, loses, ties  and the number of games played, so that I can keep track of the game history.

(c) The software runs. When the game is run by typing "ant run", the player is prompted with a game selection between tic tac toe and rock paper scissors. Upon choosing tic tac toe, each player is then prompted with character choices for the game. Once the characters are chosen, the tic tac toe board (3 x 3 grid) is displayed on the screen. Player 1 and Player 2 alternatively place their game pieces until one player gets 3 in a row horizontally, vertically, or diagonally, or until one player presses the "Go back to game selection" button. Upon choosing rock paper scissors, the game screen is displayed and the player selects one of the three options (Charmander, Bulbasaur, Squirtle) that correspond to rock, paper and scissors. Wins, ties, and loses are recorded and displayed in the bottom right corner. The game continues until the player chooses to go back to the game selection.

(c) 1. As a player of rock paper scissors, I can view a key with a game description, so that I can understand which pokemon beats which.

2. As a player of rock paper scissors, I can watch an animation of the winning character, so that I can easily understand who one the round immediately.

3. As a player of tic tac toe, I can enter my own player name, so that I can personalize my player name.

4. As a player of tic tac toe, I can see the pictures of the character slection, so that I can know what my character looks like ahead of time.

5. As a player of tic tac toe, I am notified of whose turn it is, so that I can always know for sure which players turn it is at any point in time.

(d) The README.md description is very thorough. It includes pictures of both games, snippets of the code along with small descriptions of each snippet, and how to run the software. One thing that could be added is a description of the targets in the build.xml file.

(e) The current state of the build.xml file is solid. There are no previous legacy targets that need to be removed, and all targets have clear descriptions. All the necessary targets are present.

(f) There are a good number of current issues/updates that could add up to 1000 points and that we find as interesting additions to the current state of the game. The issues have concise explanations and descriptions.

(g) #24

https://github.com/UCSB-CS56-Projects/cs56-games-rock-paper-scissors/issues/25

https://github.com/UCSB-CS56-Projects/cs56-games-rock-paper-scissors/issues/26

https://github.com/UCSB-CS56-Projects/cs56-games-rock-paper-scissors/issues/27

https://github.com/UCSB-CS56-Projects/cs56-games-rock-paper-scissors/issues/28

(h) The code is organized well into classes. The class names are descriptive (classes for players, game boards, etc.). The class names are relatively clear in their relationships, however, it would be more descriptive if there were comments stating which classes use others. The code is very readable. The RunGame.java class is the intial game screen, where the player is promted to pick one of the games. The ActionListener of each selection sets up the starting screen for that game. There is currently a Run.java class that is supposed to set up the game screen for the rock paper scissors game, but it currently serves no purpose because the RunGame.java class takes on that responsibility more effectively. The RunGame.java class creates an instance of the GameGUI.java class to start the rock paper scissors game if the player selects that game option, or creates an instance of the FirstPlayer class if tic tac toe is selected as the game. The FirstPlayer.java class sets up the attributes for the first player, and then based on those choices, creates an instance of the SecondPlayer.java class to set up the game options for the second player. Once both players have set up their game options, an instance of the actual tic tac toe class is created to bring up the game grid and calculates the winner of the game based on the player moves. The tic tac toe game is broken down into separate classes, while the rock paper scissors class is all implemented together in one class with several inner classes. One helpful addition to the code would be comments for each or most methods describing their function to the overall game. In TicTacToe.java, the firstPlayerWins() and secondPlayerWins() are almost identical and could be refactored into one function that takes the string name (the only variable that is different). In TicTacToe.java, the checkWinner() function duplicates code and could be refactored into a function that takes the player number as a paramater. In TicTacToe.java, some of the variable names (firstName, secondName, etc.) could be renamed for clarity.

(i) There are currently no JUnit tests at all. There are many opportunities to expand test coverage. Each game should be tested separately. For rock paper scissors, the test should verify that given two player choices, the winner is correct. This should be done for every combination of player choices. The tests could also check that the game histories are accurate. For tic tac toe, the test should examine all winning possibilities, and verify that each one actually results in a win, for the correct player.