注释后加空格

联网稍微推进
This commit is contained in:
MrZ_26
2022-10-03 02:43:51 +08:00
parent 06f4bb4e1a
commit f8d17b23b6
121 changed files with 1628 additions and 1622 deletions

View File

@@ -74,7 +74,7 @@ local function _getScore(field,cb,cy)
clear=clear+1
::CONTINUE_notFull::
end
if #field==0 then--PC
if #field==0 then-- PC
return 1e99
end
for x=1,10 do
@@ -116,10 +116,10 @@ local function _getScore(field,cb,cy)
-#field*30
-#cb*15
+(#field>10 and
HclearScore[clear]--Clearing
-hole*70--Hole
-cy*50--Height
-sdh--Sum of DeltaH
HclearScore[clear]-- Clearing
-hole*70-- Hole
-cy*50-- Height
-sdh-- Sum of DeltaH
or
LclearScore[clear]
-hole*100
@@ -139,10 +139,10 @@ local bot_9s={}
function bot_9s.thread(bot)
local P,data,keys=bot.P,bot.data,bot.keys
while true do
--Thinking
-- Thinking
yield()
local Tfield={}--Test field
local best={x=1,dir=0,hold=false,score=-1e99}--Best method
local Tfield={}-- Test field
local best={x=1,dir=0,hold=false,score=-1e99}-- Best method
local field_org=P.field
for i=1,#field_org do
Tfield[i]=getRow(0)
@@ -152,7 +152,7 @@ function bot_9s.thread(bot)
end
for ifhold=0,data.hold and P.gameEnv.holdCount>0 and 1 or 0 do
--Get block id
-- Get block id
local bn
if ifhold==0 then
bn=P.cur and P.cur.id
@@ -160,17 +160,17 @@ function bot_9s.thread(bot)
bn=P.holdQueue[1] and P.holdQueue[1].id or P.nextQueue[1] and P.nextQueue[1].id
end
if bn then
for dir=0,dirCount[bn] do--Each dir
for dir=0,dirCount[bn] do-- Each dir
local cb=BLOCKS[bn][dir]
for cx=1,11-#cb[1] do--Each pos
for cx=1,11-#cb[1] do-- Each pos
local cy=#Tfield+1
--Move to bottom
-- Move to bottom
while cy>1 and not _ifoverlapAI(Tfield,cb,cx,cy-1) do
cy=cy-1
end
--Simulate lock
-- Simulate lock
for i=1,#cb do
local y=cy+i-1
if not Tfield[y] then
@@ -194,7 +194,7 @@ function bot_9s.thread(bot)
end
if not best.bn then return 1 end
--Release cache
-- Release cache
while #Tfield>0 do
discardRow(rem(Tfield,1))
end
@@ -207,7 +207,7 @@ function bot_9s.thread(bot)
end
ins(keys,6)
--Check if time to change target
-- Check if time to change target
yield()
if P.aiRND:random()<.00126 then
P:changeAtkMode(P.aiRND:random()<.85 and 1 or #P.atker>3 and 4 or P.aiRND:random()<.3 and 2 or 3)