文件名称:CreateMagicMatrix
介绍说明--下载内容均来自于网络,请自行研究使用
《洛书》增强版算法解密
包括偶数阶、双偶数阶、单偶数阶等各类魔方(幻方)的生成算法源码。
其中单偶数阶最难:
单偶数魔方,n为偶数,且不能被4整除(n=6,10,14,18,22……)(n=4k+2,k=1,2,3,4,5……)。这是奇数阶魔方,双偶数阶魔方,单偶数阶魔方三种魔方里面最复杂的魔方。
以n=10为例,这时k=2。
(1)把方阵从左到右,从上到下分成A,B,C,D四个象限,这样每个象限肯定是奇数阶,用罗伯法,依次在A,D,B,C象限按奇数阶魔方的填法填数。
(2)在A象限的中间行中间列开始,按自左向右的方向标出k列,A象限的其他行则标出最左边的k列,将这些标出的数和C象限相同位置上的数互换位置。
(3)在B象限任意一行的中间列,自左向右标出k-1列,将这些标出的数和D象限相同位置上的数互换位置。魔方完成。-" Luo Shu" decryption algorithm enhancements include even order, double even order, even order, and other single cube (magic square) generation algorithm source code. Wherein the single most difficult to even order: single even Cube, n is an even number, and can not be divisible by 4 (n = 6,10,14,18,22 ......) (n = 4k+2, k = 1,2,3,4, 5 ......). This is the odd-order cube, double even order cube, Rubik three kinds of even order single most complex Rubik cube inside. Case with n = 10, then k = 2. (1) the square left to right, top to bottom is divided into A, B, C, D four quadrants, and each quadrant is certainly odd order, with Rob law, followed by the A, D, B, C quadrant press Rubik' s odd order number fill fill method. (2) A quadrant in the middle of the middle row of columns, beginning with the left-right directions marked k columns, other rows A quadrant is marked k leftmost column, the same number and location of these marked C quadrant Number of swap positions. (3) in
包括偶数阶、双偶数阶、单偶数阶等各类魔方(幻方)的生成算法源码。
其中单偶数阶最难:
单偶数魔方,n为偶数,且不能被4整除(n=6,10,14,18,22……)(n=4k+2,k=1,2,3,4,5……)。这是奇数阶魔方,双偶数阶魔方,单偶数阶魔方三种魔方里面最复杂的魔方。
以n=10为例,这时k=2。
(1)把方阵从左到右,从上到下分成A,B,C,D四个象限,这样每个象限肯定是奇数阶,用罗伯法,依次在A,D,B,C象限按奇数阶魔方的填法填数。
(2)在A象限的中间行中间列开始,按自左向右的方向标出k列,A象限的其他行则标出最左边的k列,将这些标出的数和C象限相同位置上的数互换位置。
(3)在B象限任意一行的中间列,自左向右标出k-1列,将这些标出的数和D象限相同位置上的数互换位置。魔方完成。-" Luo Shu" decryption algorithm enhancements include even order, double even order, even order, and other single cube (magic square) generation algorithm source code. Wherein the single most difficult to even order: single even Cube, n is an even number, and can not be divisible by 4 (n = 6,10,14,18,22 ......) (n = 4k+2, k = 1,2,3,4, 5 ......). This is the odd-order cube, double even order cube, Rubik three kinds of even order single most complex Rubik cube inside. Case with n = 10, then k = 2. (1) the square left to right, top to bottom is divided into A, B, C, D four quadrants, and each quadrant is certainly odd order, with Rob law, followed by the A, D, B, C quadrant press Rubik' s odd order number fill fill method. (2) A quadrant in the middle of the middle row of columns, beginning with the left-right directions marked k columns, other rows A quadrant is marked k leftmost column, the same number and location of these marked C quadrant Number of swap positions. (3) in
(系统自动生成,下载前可以参看下载内容)
下载文件列表
CreateMagicMatrix.h