小女子上次發過一個帖子了,經過2周的掙紮,還是NO IDEA AT ALL,老師堅持不肯給我提示。所以請問大家有沒有代碼可以參考,或者給我一點提示,謝謝大家的幫忙。
2. Task
At the design stage you should consider carefully the structure of your program. Your design must include a class
called Board, which represents the chess board, a class called Player to represent each player (hint: use inheritance
for the different kinds of player), and a class called Piece to represent each chess piece (hint: use inheritance for the
different pieces e.g. Pawn, King).
2.1 Stage 1 (maximum mark of 80%)
Your program should perform the following:
1. There can be three types of player.
•Computer player that makes random moves.
•Computer player that makes aggressive moves. This player will try to take a piece if possible, and move
randomly otherwise.
•Human player who makes moves using the mouse.
2. On starting, the program should allow the user to select which of the three types of player will move the black
pieces and which type of player the white pieces. (This could be done interactively in answer to questions or
could be read from a text file that is supplied when the program is run.)
3. The program should display a graphical window showing the current state of the board. This window should be
updated after each move.
4. Each piece can only make legal moves.
5. You do not have to implement castling, en passant, promotion and check.
6. The game should continue until the king is taken. At this point the player who takes the king is the winner.
2.2 Stage 2 (Stage 1 + Stage 2 gives a maximum mark of 100%)
7. You should implement the additional features of castling, en passant, promotion and check – additional marks
are available for implementing these.
8. If you have implemented check, then the game should continue until the king is in checkmate.
9. An additional type of player is required:
•Computer player that likes check – This player will try to check the opponent if possible, and move
randomly otherwise.
問題在此
所有跟帖:
• 回複:問題在此 -這是考試嗎- ♀ (307 bytes) () 10/30/2004 postreply 17:31:22
• 圖形搜索算法和遞歸是肯定要用到的 -還有一個- ♀ (0 bytes) () 10/30/2004 postreply 17:36:43
• 很多號稱4-5年Java經驗的都寫不出這東西 -DLinky- ♀ (9 bytes) () 10/30/2004 postreply 21:38:01