ࡱ> {~|G ^bjbjَ G8 ]$ <}66666BDDDDDD$3'`h<h66] 666BB"B6*4:Hello everyone, Ziba had asked me for the notes of yesterdays revision session. I thought that since I had gone to the trouble of typing them out, you might as well all have a copy. Feel free to comment. The Captains Mistress. The first thing that you must do is to look at the case study that we were given. You will notice that it is staged from one to four. Stage 1. The Analysis Classes. Using the noun identification method, we established that the analysis classes would be: - Game Player Board Rows Columns Counters Move (Turn) The Design Classes. We quickly established that Rows, Columns, Move and Counter were things that could be incorporated within the Board and Game classes. Player could also be incorporated within Game as it doesnt have many attributes. There is no need, therefore for it to have a class of its own. We also have the benefit of previous examples of programmes similar to this, such as the OXO game in which an Application class was used to kick start the game. We therefore decided to use the same approach and that Application would be called by a class Play, which comprises of just a few lines which will show the Application. This then left us with the following classes: - Play: Instantiates Application and incorporates the main method. Application: Instantiates all the variables and objects based on previous examples such as the OXO game. It also contains the graphics and user interface and handles the input. Board: Contains the playing grid and implements the rules of the game. Board Observer: Displays the board every time that it is called. Game: Manages the game logic from the user input. Game Observer: Displays messages about the game, e.g. your turn. UML Class Diagram based on the design classes.   1 O   O 1 1 O O  1 O 1 O  O UML Interaction Diagram Stage 1.     Show( )  user input (input)  is Valid Move (input)   Add Move (who,input)  Get Situation ( )   Set Message ( )  Notify Observers ( )  ( ) Notify Observers  Implementation Play: - Create an Application object. Application: - Inherits from Frame to construct a graphical window frame and title. Create a board object and a game object. Create a board observer and a game observer. Add observer to the board. Add observer to the game. Board: - To implement the playing grid, implement an array of arrays.  This is as far as we got. Continue now as per the case study sheet. Lloyd. PLAY GAME OBSERVER APPLICATION BOARD OBSERVER GAME BOARD PLAY APPLICATION GAME BOARD BOARD OBSERVER GAME OBSERVER p!5    h k s u +,-L_` %Zjk#]^j5UmH jUmHj>*UmH>*5Kopy  !56Sopy  !56S p  S        h q r s      g      ] p  S        h q r s  r     g  & Fr ,_ Sj ,_ Sj#23;YZi!;<Eÿ|xtplhd ! ^ g h     : I J h p q        9 P            D w    '#23;YZi!;<E$ $%&',-./5678?HIWXYZ[\]^   * $%&',-./5678?HIWXYZ[[\]^ &P/ =!"#$%# 0&P/ =!"#$% [(@(NormalCJmH 0`0 Heading 1$@&>*4`4 Heading 2 $$@&>*<A@<Default Paragraph Font"28?EGTV\^egx^  !"28?EGTV\^egx     # ^8"8^ [^ ^8.0@ %/ (  H  #  H  #  H  #  H  #  H   #    H   #    HB   C DHB @ C D HB  C D HB @ C D HB  C DHB  C D H  #  H  #  H  #   H  #   H  #   H  #   H  #   H  #  H  #   H  #   H  #  H ! # ! NB " S DNB # S DNB $@ S DNB % S DNB &@ S DNB ' S DNB ( S DNB )@ S DNB * S D NB , S D"NB - S D!HB / C D#B S  ?hijst   , _  j  ^$t HTHtX8t(t'$t;htH Xt`+tk`t 1t  t (t t[ 'tkt t t tkt;4 t [t!+##T!t{  tKD t"K{t#  t$ ` `t%[xxt&[t'[;t([H;Ht)[TTt*[yyt-;kt,[+#t/K%t _ _ Lloyd MooreE:\Revision notes.doc Lloyd Moore7C:\WINDOWS\TEMP\AutoRecovery save of Revision notes.asd Lloyd Moore7C:\WINDOWS\TEMP\AutoRecovery save of Revision notes.asd Lloyd Moore7C:\WINDOWS\TEMP\AutoRecovery save of Revision notes.asd Lloyd MooreE:\Revision notes.doc Lloyd Moore7C:\WINDOWS\TEMP\AutoRecovery save of Revision notes.asd Lloyd MooreE:\Revision notes.doc Lloyd MooreE:\Revision notes.doc Lloyd MooreE:\Revision notes.doc Lloyd MooreE:\Revision notes.doc]]**o(]@: : ȧ: : ^@@GTimes New Roman5Symbol3& Arial"h*E+Ejd !20d Ziba, Lloyd Moore Lloyd Moore Oh+'0`   ( 4@HPXZiba,fiba Lloyd Mooreloy Normal.dot Lloyd Moore6oyMicrosoft Word 8.0@@Nr@bd  ՜.+,D՜.+,0 hp|      Ziba, Title 6> _PID_GUIDAN{CA7B9D0C-226F-11D4-A4F3-FC605B9F4E7D}  !"#$%&'()*+-./012356789:;>Root Entry F&{*@1TableWordDocumentG8SummaryInformation(,DocumentSummaryInformation84CompObjj  FMicrosoft Word Document MSWordDocWord.Document.89q Oh+'0`   ( 4@HPXZiba,fiba Lloyd Mooreloy Normal.dot Lloyd Moore7oyMicrosoft Word 8.0@@Nr@,d  ՜.+,D՜.+,0 hp|      Ziba, Title 6> _PID_GUIDAN{CA7B9D0C-226F-11D4-A4F3-FC605B9F4E7D}p!5    h k s u +,-L_` %Zjk#]^9:(;f;<<EDFFFHFPFRFVFGj5UmH jUmHj>*UmH>*5Y &P/ =!"#$%# 0&P/ =!"#$%Hello everyone, Ziba had asked me for the notes of yesterday s revision session. I thought that since I had gone to the trouble of typing them out, you might as well all have a copy. Feel free to comment. The Captain s Mistress. The first thing that you must do is to look at the case study that we were given. You will notice that it is staged from one to four. Stage 1. The Analysis Classes. Using the noun identification method, we established that the analysis classes would be: - Game Player Board Rows Columns Counters Move (Turn) The Design Classes. We quickly established that  Rows, Columns, Move and Counter were things that could be incorporated within the Board and Game classes.  Player could also be incorporated within  Game as it doesn t have many attributes. There is no need, therefore for it to have a class of its own. We also have the benefit of previous examples of programmes similar to this, such as the OXO game in which an Application class was used to kick start the game. We therefore decided to use the same approach and that Application would be called by a class  Play , which comprises of just a few lines which will  show the Application. This then left us with the following classes: - Play: Instantiates Application and incorporates the  main method. Application: Instantiates all the variables and objects based on previous examples such as the OXO game. It also contains the graphics and user interface and handles the input. Board: Contains the playing grid and implements the rules of the game. Board Observer: Displays the board every time that it is called. Game: Manages the game logic from the user input. Game Observer: Displays messages about the game, e.g.  your turn . UML Class Diagram based on the design classes.   1 O   O 1 1 O O  1 O 1 O  O UML Interaction Diagram  Stage 1.     Show( )  user input (input)  is Valid Move (input)   Add Move (who,input)  Get Situation ( )   Set Message ( )  Notify Observers ( )  ( ) Notify Observers  Implementation Play: - Create an Application object. Application: - Inherits from  Frame to construct a graphical window frame and title. Create a board object and a game object. Create a board observer and a game observer. Add observer to the board. Add observer to the game. Board: - To implement the playing grid, implement an array of arrays.  This is as far as we got. Continue now as per the case study sheet. Lloyd. PLAY GAME OBSERVER APPLICATION BOARD OBSERVER GAME BOARD PLAY APPLICATION GAME BOARD BOARD OBSERVER GAME OBSERVER >AAAAvB(CCjDDTEEEEEBFDFFFJFLFNFPFTFVFvFG*G,G.GrGG.G2G^HbHZJ^JxKzKKKKKKKLLLLL L.LLLLLMMMMMMMM(N*N* jUmH=.G\H^HdHfHhHjHlHdIZJ`JKxK~KKKKKKKKKKKKKKKK & FrKKKKKKKKKKLLLHLLMMMMMMN(N.N0NbN|NNOjOjOO PFPvPPPPPPPQQQTRRRRRLSNSRSSSSSSTT$T,T.TLTNTXTZTfThTrTtTvTxTTTTTTTTTTTTTTTTTTTTTTUUU &P/ =!"#$%# 0&P/ =!"#$%lfs({ HzeIYHȫhG'c|lx|Ij- t9l+̬lō f{s({'zDIQGhgHk|d7tr&g&r{l9l K촍+F{szhHzdIQGG&&c\d7lgbrzzrDbZs}ldjHHHHH sszGzrDA9hggG抦c<\d(JQZZQA)R9l]\cjHHhJMȋjr'r'zrDAiJͨggg[S[\]^h8j8999::&;(;:;f;h;< <*<8<D<N<^<p<<<<<=> [(@(NormalCJmH 0`0 Heading 1$@&>*4`4 Heading 2 $$@&>*<A@<Default Paragraph Font"28?EGTV\^egx^  !"28?EGTV\^egx     # ^d"dopy  !56SpShqrs   g , _  S j  # 2 3 ; Y Z i  ! ; < E  $%&',-./5678?HIWXYZ[\_@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@# @# @# @# @# @# @# @# @# @# @# @# @# @# @# @# @# # ""2"888888888888888888@888888888GU, [>.GKjOTTU+-./01 ^Unknown Lloyd Moore8.0@ %/ (  H  #  H  #  H  #  H  #  H   #    H   #    HB   C DHB @ C D HB  C D HB @ C D HB  C DHB  C D H  #  H  #  H  #   H  #   H  #   H  #   H  #   H  #  H  #   H  #   H  #  H ! # ! NB " S DNB # S DNB $@ S DNB % S DNB &@ S DNB ' S DNB ( S DNB )@ S DNB * S D NB , S D"NB - S D!HB / C D#B S  ?hijst   , _  j  ^$t HTHtX8t(t'$t;htH Xt`+tk`t 1t  t (t t[ 'tkt t t tkt;4 t [t!+##T!t{  tKD t"K{t#  t$ ` `t%[xxt&[t'[;t([H;Ht)[TTt*[yyt-;kt,[+#t/K%t _ _ Lloyd MooreE:\Revision notes.doc Lloyd Moore7C:\WINDOWS\TEMP\AutoRecovery save of Revision notes.asd Lloyd Moore7C:\WINDOWS\TEMP\AutoRecovery save of Revision notes.asd Lloyd Moore7C:\WINDOWS\TEMP\AutoRecovery save of Revision notes.asd Lloyd MooreE:\Revision notes.doc Lloyd Moore7C:\WINDOWS\TEMP\AutoRecovery save of Revision notes.asd Lloyd MooreE:\Revision notes.doc Lloyd MooreE:\Revision notes.doc Lloyd MooreE:\Revision notes.doc Lloyd MooreE:\Revision notes.doc]]**o(]@: : ȧ: : ` =>ghiRdGN!"Z Jghijkoprstu      + , - K L V W ^ _ ` ~       $ % * - R S Z f i j k u       " # 1 8 : ; X Y f w x } w  #$%&'+,-./45678>?GHIVWXYZ[\]^AH8Ad8@f8@h8Aj8A8A8A9A9A9Az9A9A9A9A9@9@9@9A@AA@NAAB@BAD@D@DAEAE@E@EAEA>F@@F@BF@DFAFF@HF@NFAPF@RF@TFAVFA`FAdFArF@tFAvFAF@GAGAGAGAGA&G@(G@,GA.GA0GA2GAGAGAGAGAGAGAGA HA HA"H@ZHA^HA`H@bH@dHAlH@bIAdIAIAI@XJAZJA\J@^J@`JAxKAzK@|K@~K@KAK@K@K@K@K@K@K@K@K@K@K@K@K@K@K@KAKAKAKAK@KAKAK@KAKAKAKAK@LALALALALA LA L@L@LALALA LA"LA*LA.LA4LA6LABL@FLAHLAtL@LALALALALALAL@MAMAMADMAMAMAMAM@M@MAMAM@MAMAM@M@MAMAMAM@MAN@&NA(NA*N@,N@.NADNAFNAXN@ZNAbNAdNApN@zNA|NA~NANANANAN@NANANAO@OAOAOA2O@RO@OAOAOAOAOAO@ PA PAPA _PID_GUIDAN{CA7Bd