整理代码

This commit is contained in:
MrZ626
2021-11-16 20:25:21 +08:00
parent 7a0b913768
commit 3f455ee360
4 changed files with 9 additions and 5 deletions

View File

@@ -8,6 +8,10 @@ function MATH.sign(a)
return a>0 and 1 or a<0 and -1 or 0
end
function MATH.roll(chance)
return rnd()<(chance or .5)
end
function MATH.coin(a,b)
if rnd()<.5 then
return a

View File

@@ -90,7 +90,7 @@ local function newTile()
if nextCD>0 then
nextTile=1
else
nextTile=rnd()>.1 and 2 or rnd()>.1 and 3 or 4
nextTile=MATH.roll(.9)and 2 or MATH.roll(.9)and 3 or 4
nextCD=rnd(8,12)
end

View File

@@ -39,7 +39,7 @@ end
local function start()
state=1
vx=rnd()>.5 and 6 or -6
vx=MATH.coin(6,-6)
vy=rnd()*6-3
end
function scene.keyDown(key,isRep)

View File

@@ -29,10 +29,10 @@ local typeColor={
english=COLOR.B,
name=COLOR.lV,
}
local function _filter(word)
local word_org=word
if FNSF then word=word:gsub("[Pp]atreon",CHAR.zChan.spark)end
local function _filter(word_org)
local word=word_org
word=word:gsub("[Tt]etris",CHAR.zChan.thinking)
if FNSF then word=word:gsub("[Pp]atreon",CHAR.zChan.qualified)end
return word,word_org
end
local function _scanDict(D)