关键字:魔方;魔方还原算法;求解效率;Windows 编程;OpenGL
Design and Implementation of Cube Game
Abstract
Magic cube is an intellectual toy with great variety; also know as Rubik’s cube, which was invented by the Hungarian architectural professor Rubik in 1974. Due to its endless profound, not only there are a number of fans to the magic cube game, also there are many wide and deep studies about magic cube in academia, including Math, Physics and so on, and the research can be applied to various fields.
The dissertation based on the need of implementing Rubik’s cube on the computer, giving an in-depth analysis to the “by layer solution” which is in common use in the cube’s recovery at present and abstracting a “by layer algorithm”, then realize the algorithm on computer at last. Next based on the algorithm, use the powerful scene rendering and depicting function of the OpenGL API, design a 3D cube game based on the OpenGL platform. By dealing with the input message, the user can play the game by mouse or keyboard. When the manual recovery is in trouble, the player can make the computer solve the cube by the designed algorithm automatically and offer a dynamic revolving effect.
The whole game has a friendly user interface and a vivid effect, along with a automatic solving function, making the players have both the game joy and the cube solving hint.
Finally, the conclusion of this dissertation has been given and the development trend has been predicted.