Skip to content

Latest commit

 

History

History
98 lines (65 loc) · 8.49 KB

M16_lab02.md

File metadata and controls

98 lines (65 loc) · 8.49 KB

Names: Bryanna Phan (bryannaphan) and Joel Bagan (joelbagan)

#Assessment:

a) A connect four game that allows for multiplayer (human vs human) and singleplayer (human cs computer)

b) As a single player I can, open the rules, choose my dot color and that of the computer, enter my name, choose to play vs an easy AI and an advanced AI. As a player vs player I can, choose my own color, the other player can choose theirs, choose our names, and play the game until we win or draw

c) The software does run, with minor GUI bugs where parts of the screen will disappear until you mouse over it and the advanced AI is a little weak

d) User Stories:

  1. Joel Bagan: Adding in different game modes i.e. Connect 5, power ups, pop-off. Enhance AI.

  2. Bryanna Phan: Adding in a coin flip for who gets first move. Enahnced GUI, maybe add in graphics for coin toss and victory

e) Maybe more detail in the Documentation section on the approach to certain classes, more specifically the SinglePlayer*.java on how the AI makes decisions. In the Features section add that you can edit settings, choose a name and color, access to rules, which are all in the README but scattered around. In How To Run, include information on how to run the program locally on your laptop, if you aren't in CSIL or lab.

f) The javadoc, test, and jar don't have descriptions. No JWS stuff that we can see that needs to be removed.

g) Yes there are enough to earn 1000 points. The "Better UI" issue is a little vague as to what the actual expectations are.

h) Additional Issues:

  1. #46
  2. #47

i) Assesment of Code: ####Notes on code

  • no getter for player names, although never needed outside of board class itself

  • Player state (color of circles) represetned by an int, which is efficient but can be confusing

  • paint() method seems redundant in that it redraws entire board every time (as far as we could tell). Can be improved to paint just the new circle, may need to redesign the board() constructor to draw the empty board

  • unsure of why Circle.draw(Graphics g) makes a variable Graphics create = g.create(); and never uses it anywhere else in the function.

  • For the X11 bug, it seems the only issue is that you can click undo before the computer makes its move, however in either case the correct circles are popped and it ends in your turn.

  • p1Name and p2Name are private instance variables in both Board and startScreen2, neither are inherited from the other, seems redundant.

  • In startScreen2, more documentation on the constructor would be very helpful i.e. what the code below is actually doing

this.add(startpanel);
this.addMouseListener(new MouseClass());
  • Line 144 of startScreen2, just doesn't have this.remove(ss); which is sort of implied but inconsistent with the rest of the code

  • Indentation on BackToStartScreen() is all wonky, and first letter is capitalized when that's conventionally for objects and not methods

  • Line 308 of startScreen2 else if ((gameMode == 2) || (gameMode == 3)) { add comment about which gameMode is which (1 multi, 2 easy, 3 advanced)

  • Line 367 of startScreen2 could use some clarification, but from what we could tell it's checking if the next circle down is filled, then checking if the top is filled, then if neither of these are true it continues, else it returns nothing

  • Line 380 of startScreen2, comment is slightly incorrect in that the circle's state is set to the player state of whose turn it is (not necessarily 1 or 2)

  • Some instance variables seem redundant, e.g. Circle has its own x,y pair whereas it seems like it could just have an instnace variable of IntPair, other cases include p1name and p2Name being in both Board and StartScreen2.

####Overall Assessment Overall, the purpose of the classes and their methods are clear, with some exceptions being methods with little documentation and convoluted statements that are difficult to decipher without documentation. The classes are related to one another fairly obviously, the board object handles the actual game board data, like the 2D array of circles, drawCounter, etc, while the startScreen2 class handles all of the menus and GUI in general, calling the board Object to create the game board and populate the array. Circle and Intpair are fairly simple; Circle objects have a size, location, and color, and IntPairs are simply the x,y coordinates of each circle. Each of the different menus has its own .java file, and are all managed by the startScreen2 class. If we were to give someone a page of text to help get up to speed, we would say: Learn JPanel and JFrame methods to be able to fully understand the startScreen2 and Board classes, take a close look at the startScreen2 methods that handle mouse clicks, and be sure you understand how it iterates through the board, also how X and Y axes are oriented (Y positive down, and X positive right).

j) There are currently no tests, but due to the nature of the program being interactive and involving mouseclicks, it would difficult to create entire simulations for each test case, whereas it would be far easier to simply test these cases by running the programand creating the test cases yourself. There are opportunities to expand testing, but the tests would more likely not involve JUNIT, rather recreating situations ourselves by running the program.

####Proposal for README changes:

  • Bugs:
    • When entering names for multiplayer, the game board is shifted down by the height of the name field at the top and cuts off part of the bottom row of circles
    • In a multiplayer game session, it seemed to give a false win, did not identify the winning circles with green, and seemed to change some circles that were already on the game board to player 2's color
    • When playing a second session of multiplayer after already choosing names in the first session, the first turn of session 2 displays Player 2's name from session 1
    • When a game is won, the some or all of the winning circles are being set to white, sometimes circles are being set to the loser's color
  • Tests: This project doesn't have any JUNIT tests, presumably because it would be difficult to simulate playing the game, when it could much more easily be tested by playing the game and creating test cases yourself
  • Suggestions:
    1. Refine the rules page and update it for possible game modes that will be added
    2. GUI:
    • Clean up menus, center/space out buttons
    • Improve victory display
    • Add in coin toss and display for coin toss
    1. Add more documentation to the methods and constructors, especially in startScreen2
    2. Also rename startScreen2 to StartScreen2 to follow naming convention and fix any problems this may cause
    3. Refactoring: Possibly refactoring startScreen2 to have a subclass that handles all possible game modes, instead of the one and only game mode being run from inside startScreen2
    4. Issues:
    • #13 seems as though it was resolved but the issue is still up, unsure of whether it is still an open issue
    • #28 unclear of how many points per game mode or how many new modes are expected to be added
    • An idea for a new issue; Adding in options for different game board colors/gradient option
    • Since so much of the game is already done, and a lot of the improvements we want to make are UI based, we may want to split the general "Better UI" issue into smaller, more specific additions and renegotiate points
    • If we add in the "Power Up" game mode we would have to add in algorithms to the AI to be able to play intelligently with the new chips, another option would be to get Power Up working in multiplayer and leave the AI enhancements as an issue for the next generation
    1. README: Update the pictures to inlcude the name entering menu, possible game mode selection screen, any future menus that we add etc

####Code Related Stuff:

  1. Lines: In startScreen2, lines 308, 367, 380 could use documentation as the methods are currently vague as to what they're acutally doing (mentioned above in "Notes on code")
  2. Nothing we found was unneccessary, but the format (spacing, indents, newlines) was a little disorganized. Possibly add in messages to compile and javadoc to remind user to update their javadoc to see changes online
  3. Package naming convention seems correct
  4. Unsure of meaning, but the methods works, except for the X11 bug and menu buttons shifting down (unsure if this was fixed previously)
  5. If we add in new game modes we will most likely have to refactor the startScreen2