From 392798d7f514345b3d75f045cf2f0d36d72adb48 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 12 Mar 2021 11:26:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/list.lua | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/parts/list.lua b/parts/list.lua index fa4b5290..8ddc35e6 100644 --- a/parts/list.lua +++ b/parts/list.lua @@ -230,17 +230,6 @@ do--SCS(spinCenters) } end do--BLOCKS - local function RotCW(B) - local N={} - local r,c=#B,#B[1]--row,col - for x=1,c do - N[x]={} - for y=1,r do - N[x][y]=B[y][c-x+1] - end - end - return N - end local O,_=true,false BLOCKS={ --Tetramino @@ -282,12 +271,24 @@ do--BLOCKS --Dot {{O}}, --O1 } + local function RotCW(B) + local N={} + local r,c=#B,#B[1]--row,col + for x=1,c do + N[x]={} + for y=1,r do + N[x][y]=B[y][c-x+1] + end + end + return N + end for i=1,#BLOCKS do local B=BLOCKS[i] BLOCKS[i]={[0]=B} - B=RotCW(B)BLOCKS[i][1]=B - B=RotCW(B)BLOCKS[i][2]=B - B=RotCW(B)BLOCKS[i][3]=B + for j=1,3 do + B=RotCW(B) + BLOCKS[i][j]=B + end end end