SOS Version 0.5

Sunday, June 28, 2009 15:16
SOS UML Diagram v. 4

SOS UML Diagram v. 4

I now have a production version of my SOS program, with mainly just essential functionality.  That is I only have one board size to use, the ability to change the player names, start a new game with the same board size, exit, display instructions and about information, and of course play an entire game from start to finish.  If you do not wish to skip to the download, scroll to the bottom of this post.

The UML diagram of v. 0.5, includes some things that are not implemented in this version, namely the difficulty variables within MenuBar, but may be implemented for version 1.0.  I am hoping I can figure out how to include URLs that are clickable for the About section.  More importantly I would like different difficulty settings (some of the code is already in place, just not active) once I figure out how to re-draw the board properly with the different grid sizes and a correctly responding mouse listener.

The following is a summary of my progress this week leading to my first public release:

  • Board:
    • changed checkTopDownDiag to checkForTopDownDiag
    • changed checkBottomTopDiag to checkForBottomTopDiag
    • added variable newBoard to signify when a new board size has been created
    • added method oldBoard to set state to false once the view has been informed
    • setSquare now returns number of SOSs created on last play so can be store in Move
  • MenuBar:
    • added variable group so that only one difficulty can be selected at a time
    • added variable cbEasyItem, cbMediumItem, cbHardItem so that I could use isSelected, on the three added to the group, because if I reused the variable the isSelected would only work on the last one added, without it, the current and previous selection code would execute
    • startNewGame method added to remove major code duplication, and just called from each place with the rows and cols for the new board as parameters
    • used JOptionPane to show About and Instruction information
  • Move:
    • added variable currPlayer to store the player who made the move if a point was scored so know to deduct a point when user undoes a particular move
    • added variable points to store the points generated by this move
    • added methods getPlayer and getPoints
  • Player:
    • added method subFromTally so that if in the event of undowing a move, if on that move an SOS was formed, they can be subtracted from the players tally
  • TurnView broken into TurnView and Turn to keep consistent with rest of program, not sure why I didn’t see to do this first thing:
    • created class Turn

Download:

Windows (all): Game of SOS v. 0.5 (exe)
Linux (right click and open with Java): Game of SOS v. 0.5 (jar)
Mac users should be able to use the same as Linux.

You can leave a response, or trackback from your own site.

Leave a Reply