Advertisement
Guest User

Untitled

a guest
May 18th, 2017
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. Bryan <b@n.com> Wed, Apr 7, 2010 at 10:16 AM
  2. To: luge <luge@g.com>
  3.  
  4. khmer,
  5.  
  6. Just left you a phone message. I'd like to touch base again, from
  7. where we left off.
  8.  
  9. More details in the phone message. Ping me back as you're able.
  10.  
  11. Thanks,
  12.  
  13. Bryan
  14.  
  15.  
  16.  
  17. khmer luge <luge@g.com> Wed, Apr 7, 2010 at 11:40 AM
  18. To: Bryan <b@n.com>
  19.  
  20. Hi Bryan,
  21.  
  22. First of all, attached please find my Word resume. Second, I can't believe I didn't just say "Board, Move, Pieces, Players".
  23.  
  24. Cheers,
  25.  
  26. khmer
  27.  
  28. resume_apr_2010.doc 30K
  29.  
  30.  
  31.  
  32. Bryan <b@n.com> Wed, Apr 7, 2010 at 1:58 PM
  33. To: khmer luge <luge@g.com>
  34.  
  35. Is move a method or an object?
  36.  
  37. where would you put the move method?
  38.  
  39. :)
  40.  
  41. b.
  42.  
  43.  
  44.  
  45. khmer luge <luge@g.com> Wed, Apr 7, 2010 at 3:12 PM
  46. To: Bryan <b@n.com>
  47.  
  48. If Move is a method, then it's a method of Piece, which is a base class for King, Queen, Rook, &c.
  49. Piece.move(String coords) changes the state of Board.
  50.  
  51. If Move if an object, then it is a base class. The Board object contains a stack of Move objects, which makes up the whole game (instead of storing an associative array of static board position).
  52.  
  53. Subclasses KingMove, QueenMove, RookMove, BishopMove, KnightMove, PawnMove and Castle implement Move. Each subclass of Move has its own movement restrictions, and also asks the Board to validate the Move (validate() is a Board method, not its own class as I suggested before). So you can "undo" a move by popping it from the stack, which removes the Move and also changes the state of Board. I think that's a neat way to implement a whole chess game using Board, Moves, and Players, but no Pieces.
  54.  
  55. I'm totally buying and reading that book today, but...am I further on track?
  56.  
  57.  
  58.  
  59. Bryan <b@n.com> Wed, Apr 7, 2010 at 3:34 PM
  60. To: khmer luge <luge@g.com>
  61.  
  62. well.. move is a behavior ;) So it's a method.
  63. Calling Move an object is just strange :)
  64.  
  65. --- extra credit
  66.  
  67. You mentioned base and sub classes, why not have a piece interface?
  68.  
  69. --- extra credit
  70.  
  71. Why have polymorphism at all?
  72.  
  73. If you can understand the types of polymorphism - and why OO exists in
  74. the first place.. what problems with functional _problem_
  75. decomposition led to the introduction of OO problem decomp.. then the
  76. light bulbs will go off..
  77.  
  78. ---
  79. b.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement