制作不易,请好好欣赏
U→R→F→D→L→B
废话不多说,上脚本
--魔方基本运行程序
--星空露珠优化脚本lua
--主核心来自分享
--666
--[=[
#G4=I 1# 2-----------2------------1
# | U1(0) U2(1) U3(2) |
# | |
# 3 U4(3) U5(4) U6(5) 1
# | |
# | U7(6) U8(7) U9(8) |
# 2-----------3------------3-----------0------------0-----------1------------1------------2------------2
# | L1(36) L2(37) L3(38) | F1(18) F2(19) F3(20) | R1(9) R2(10) R3(11) | B1(45) B2(46) B3(47) |
# | | | | |
# 11 L4(39) L5(40) L6(41) 9 F4(21) F5(22) F6(23) 8 R4(12) R5(13) R6(14) 10 B4(48) B5(49) B6(50) 11
# | | | | |
# | L7(42) L8(43) L9(44) | F7(24) F8(25) F9(26) | R7(15) R8(16) R9(17) | B7(51) B8(52) B9(53) |
# 3-----------7------------5-----------4------------4-----------5------------7------------6------------3
# | D1(27) D2(28) D3(29) |
# | |
# 7 D4(30) D5(31) D6(32) 5
# | |
# | D7(33) D8(34) D9(35) |
# 6-----------6------------7
# 用于转换两种表示方式 20个棱块角块 <---> 54个面
# [UF, UR, UB, UL,DF, DR, DB, DL, FR, FL, BR, BL] [UFR, URB, UBL, ULF, DRF, DFL, DLB, DBR]
# UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB
]=]local edge_to_face ={{'UF',7 ,19},{'UR',5 ,10},{'UB',1 ,46},{'UL',3 ,37},
{'DF',28,25},{'DR',32,16},{'DB',34,52},{'DL',30,43},
{'FR',23,12},{'FL',21,41},{'BR',48,14},{'BL',50,39}}
local corner_to_face ={{'UFR',8 ,20,9 },{'URB',2 ,11,45},{'UBL',0 ,47,36},{'ULF',6 ,38,18},
{'DRF',29,15,26},{'DFL',27,24,44},{'DLB',33,42,53},{'DBR',35,51,17}}
local edge_index = {'UF','UR','UB','UL','DF','DR','DB','DL','FR'