ࡱ> .0-G bjbjَ )&]jjjjj v,j Z \ \ \ \ \ \ $K?  Z &"H"Z Rr TZ  G$jj0L Team #12 (Tom Giggler, David Jackson) CS 511 Project 1.1: Detailed Design for Dots and Boxes 1. Representation of the board A generic Frame for Boxes Slots Fillers Name box Configuration (leftedge, rightedge, topedge, and bottomedge) Location box number The number of taken edges (1 to 4) The number of selected edges (1 to 4) (used for dividing groups) A generic Frame for Edges Slots Fillers Name edges Location edge number Statue (taken, untaken) Shared by boxes (yes, no) Shared by which two boxes (leftbox, rightbox) Selected when dividing group (yes, no) Coordinate (x1 y1, x2 y2) A generic Frame for Groups (used for dividing groups) Slots Fillers Name group number Member box numbers Total number of members integer (less than 35) An instance of a box Slots Fillers Name box9 Configuration (8, 10, 2, and 16)) Location 26 The number of taken edges (3) The number of selected edges (3) (used for dividing groups) An instance of an edge Slots Fillers Name edge26 Location 26 Statue taken Shared by boxes yes Shared by which two boxes (10, 11) Selected when dividing group yes Coordinate (150, 50, 150,100) (used for interface) An instance of a group Slots Fillers Name 1 Member (1, 2, 8) Total number of members 3 2. Rules to win the game In our program there are two modules---MAIN module and GROUP module. The MAIN module includes two phases---player-computer and player-human. The interface functions are included in the MAIN module. The GROUP module is used only for dividing groups, which are planed to select the group having the least number of boxes. MAIN MODULE: Section 1: Definition of MAIN module Section 2: functions or interface Section 3: phase of player-human. It includes the following rules: Rule1. IF the edge has been taken THEN force human to chose another edge Rule2. IF human chooses the fourth edge of a box which has had three taken edges THEN let human chose again Rule3. IF human chooses an edge in a box which did not have three taken edges THEN change player Section 4: phase of player-computer. It includes the following rules Rule4. IF there is a box which has had three taken edges AND it belongs to a group of size 3 or more THEN take this edge and let computer take again Rule5. IF there is a box which has had three taken edges AND it belongs to a group of size 1 THEN take this edge and let computer take again Rule6. IF there is a box which has had three taken edges AND it belongs to a group of size 2 THEN take the remaining edge from the other box to form a domino and let human take a turn Rule7. IF there is not a box which has had three taken edges AND there is a shared edge which leftbox and rightbox have 0 or 1 taken edges THEN take this edge Rule8. IF there is not a box which has had three taken edges AND there is an unshared edge which its box only have 0 or 1 taken edges THEN take this edge. Rule9. IF every untaken shared edge can make their adjacent boxes become three taken edges if the untaken edge should be taken AND every box on four sides has 1 or 2 or 3 or 4 taken edges THEN start to divide the group and go to GROUP module. Rule10. IF the dividing of the groups has been finished THEN chose the group which has the least number of boxes. Rule11. IF the group which has the least number of boxes has been chosen AND the group size is greater than 2. THEN chose any box in the group and take an untaken edge in this box Rule12. IF the group which has the least number of boxes has been chosen AND the group size is equal to 2 THEN chose then untaken edge between the two boxes Rule13. IF finished choosing the edge from a box in a group which has the least number of boxes THEN delete all the groups just created and prepare for dividing groups next time. GROUP MODULE Rule14. IF start to divide the group THEN select any shared edge which its leftbox and rightbox have 2 taken edges and make a box have three selected edges Rule15. IF there is a box having three selected edges THEN add the fourth edge for this box and make it have four selected edges. Rule16. IF there is not a box having three selected edges THEN change the box having 0 or 1 taken edges to 0 or 1 selected edges AND repeat Rule14 and Rule15. Rule17. IF finished dividing groups THEN go to the phase player-computer in the MAIN module e3I" c x  $ _ ` f  & m q 8 : j p SY\cij6556>&-]^<dBk&d23I\k,>N`w " . C _ &d_ ` y {  _    o 8 j V0h=S \e~ ijwK9^h0^h' 0&P1h/ =!"#$% [8@8 NormalCJ_HaJmH sH tH 2@2 Heading 1$@&5\:@: Heading 2$h@&^h5\<A@< Default Paragraph Font&    ] _ ^ /68@   $ fj i s 1 < ej  % David JacksondC:\My Documents\Previous School Years\College 00-01\Summer 01(Yr3-Qtr4)\CS 511\Detailed Design 1.doc David JacksonA:\Detailed Design 1.doc Rex JacksonA:\Detailed Design 1.doc+Ejc@'H*$ MJY3 U2^`o(.^`.pLp^p`L.@ @ ^@ `.^`.L^`L.^`.^`.PLP^P`L.808^8`0o(.^`.pLp^p`L.@ @ ^@ `.^`.L^`L.^`.^`.PLP^P`L.808^8`0o(.^`.pLp^p`L.@ @ ^@ `.^`.L^`L.^`.^`.PLP^P`L.^`o(.^`.pLp^p`L.@ @ ^@ `.^`.L^`L.^`.^`.PLP^P`L.c@'H+E3 U M@s@@GTimes New Roman5Symbol3& Arial"qhBWBWBW!>0%Team #12 (Tom Giggler, David Jackson) David Jackson Rex JacksonOh+'0   4@ \ h t &Team #12 (Tom Giggler, David Jackson)t eam David JacksoniDavDav Normal.dots Rex Jackson3x Microsoft Word 8.0e@Ik@V@E@՜.+,D՜.+,X hp   Personal(  &Team #12 (Tom Giggler, David Jackson) Title 6> _PID_GUIDAN{A9FFDBE0-7390-11D5-97C1-00A0242B6B81}  !"#$&'()*+,/Root Entry F` <J11TableWordDocument)&SummaryInformation(DocumentSummaryInformation8%CompObjj  FMicrosoft Word Document MSWordDocWord.Document.89q