1. 程式人生 > >【原始碼】魔方模擬器與求解器version 1.9.0.0

【原始碼】魔方模擬器與求解器version 1.9.0.0

在這裡插入圖片描述

本程式能夠產生一個任意尺寸的隨機打亂的立方體,可以通過手動操作或者由計算機求解進行魔方復原。

This program allows you to generate arandomly scramble cube of arbitrary dimension which can then be manipulatedmanually or solved by the computer.

可以通過網路攝像機(3x3x3)輸入自定義的狀態,或者手動定義立方體每一面的顏色。

You can also input your own state using awebcam (3x3x3), or simply enter the colors of each facelet (2,3,4x.x.).

本程式包含的計算機求解方法有:

  1. 用於2x2x2的God演算法;
    
  2.  用於3x3x3的Thistlethwaite45 (T45)演算法;
    
  3.  Layer-by-Layer演算法,一般適用於初學者,雖然該演算法簡單明瞭,但相對T45的效率更低,求解步驟更多;
    
  4.  用於4x4x4的423T45演算法;
    
  5. 反逆序恢復演算法Inverse Scramblefor all cubes。
    

以上所有演算法的理論與設計描述都包含在相應的PDF文件中。

algrot.m - calculates how an algorithmchanges under rotation of the cube.
digrub.fig - GUI figure main program
digrub.m - GUIDE-generated m-file to go with digrub.fig.
editstate.fig - GUI figure for manual input program
editstate.m - GUIDE-generated m-file to go with editstate.fig.
findpeeks.m - Peek-finder that is used to find the cube’s position in a webcamimage.
GetCorners.m - calculates the corner permutation/orientation of a given 3x3x3cube.
GetCorners2.m - calculates the corner permutation/orientation of a given 2x2x2cube.
GetEdges.m - calculates the edge permutation/orientation of a given 3x3x3cube.
GetFacelets.m - converts a state in the orientation/permutation representationto the facelet repr.
Ind2State.m - converts an index to a state
move2rub.m - converts a move of the form ‘x11’ to Rubik’s Code ‘B’.
parity.m - calculates the parity of a permutation.
rub2move.m - converts a move in Rubik’s code to axile ‘x11’ form.
rubcheck.m - checks the validity of a 2x2x2 or 3x3x3 state.
rubcross.m - searches for a cross on the cube.
rubgen.m - generates a cube
rubinfo.m - returns information about the cube state
rubopt.m - optimizes a move-sequence
ruborient.m - orients the cube
rubplot.m - plot a 3D image of the cube
rubrot.m - apply a move to the cube
rubrot2.m - rotate the entire cube
rubsolve.m - solve the cube using a layer by layer approach
Solve45.m - solve the cube using T45
Solve222.m - find God’s Algorithm to a 2x2x2 cube
Solve444.m - find a solution to any 4x4x4 cube.

作者Joren Heit電子郵箱:[email protected]

原始碼下載地址:

http://page5.dfpan.com/fs/cl4c4j02e2c1c2a9166/

更多精彩文章請關注微訊號:在這裡插入圖片描述