HBC51034更相减损术,递归The Rotation Game题解 (therotationgameuses)

傲然天下 STL编程 103 0
题库丰富多样,涵盖各个领域,全网最全C++题库,让您在练习中不断成长!
The rotation game uses a # shaped board, which can hold 24 pieces of square blocks . The blocks are marked with symbols 1, 2 and 3, with exactly 8 pieces of each kind.Initially, the blocks are placed on the board randomly. Your task is to move the blocks so that the eight blocks placed in the center square have the same symbol marked. There is only one type of valid move, which is to rotate one of the four lines, each consisting of seven blocks. That is, six blocks in the line are moved towards the head by one block and the head block is moved to the end of the line. The eight possible moves are marked with capital letters A to H. Figure 1 illustrates two consecutive moves, move A and move C from some initial configuration.

The rotation game uses a # shaped board, which can hold 24 pieces of square blocks (see Fig.1). The blocks are marked with symbols 1, 2 and 3, with exactly 8 pieces of each kind.  Initially, the blocks are placed on the board randomly. Your task is to move the blocks so that the eight blocks placed in the center square have the same symbol marked. There is only one type of valid move, which is to rotate one of the four lines, each consisting of seven blocks. That is, six blocks in the line are moved towards the head by one block and the head block is moved to the end of the line. The eight possible moves are marked with capital letters A to H. Figure 1 illustrates two consecutive moves, move A and move C from some initial configuration. 

HBC51034更相减损术,递归The Rotation Game题解
(therotationgameuses)-第1张图片-东莞河马信息技术
(图片来源网络,侵删)

标签: HBC51034更相减损术 递归The Rotation Game题解