HDU 4121 xiangqi 解题报告.docVIP

  • 13
  • 0
  • 约7.28千字
  • 约 8页
  • 2017-02-13 发布于江苏
  • 举报
Xiangqi Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2393 Accepted Submission(s): 576 Problem Description Xiangqi is one of the most popular two-player board games in China. The game represents a battle between two armies with the goal of capturing the enemy’s “general” piece. In this problem, you are given a situation of later stage in the game. Besides, the red side has already “delivered a check”. Your work is to check whether the situation is “checkmate”. Now we introduce some basic rules of Xiangqi. Xiangqi is played on a 10×9 board and the pieces are placed on the intersections (points). The top left point is (1,1) and the bottom right point is (10,9). There are two groups of pieces marked by black or red Chinese characters, belonging to the two players separately. During the game, each player in turn moves one piece from the point it occupies to another point. No two pieces can occupy the same point at the same time. A piece can be moved onto a point occupied by an enemy piece, in which case the enemy piece is captured and removed from the board. When the general is in danger of being captured by the enemy player on the enemy player’s next move, the enemy player is said to have delivered a check. If the generals player can make no move to prevent the generals capture by next enemy move, the situation is called “checkmate”. We only use 4 kinds of pieces introducing as follows: General: the generals can move and capture one point either vertically or horizontally and cannot leave the “palace” unless the situation called “flying general” (see the figure above). “Flying general” means that one general can “fly” across the board to capture the enemy general if they stand on the same line without intervening pieces. Chariot: the chariots can move and capture vertically and horizontally by any distance, but may not jump over intervening pieces Cannon: the cannons move like the chariots, horizontall

文档评论(0)

1亿VIP精品文档

相关文档