|
-
July 2nd, 2010, 07:43 AM
#2
Re: chess game ;array_bug selection_of_pieces_in_chess_game
The code shown works, can you show the code that does not work.
you can also give some more efficient mechanism for identify d piece on chess board.
Each piece type should be represented by a class which probably should all inherit from a base class eg ChessPiece . The class type will then be the piece identifier and there could be a method eg isWhite() to determine which side the piece belongs too. Each piece class could also have methods to determine things such as all possible legal moves from the current position; handling of special rules such as castling, en passant and promotion etc.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|