From 59c63da36fbcd63983d82ba1fe5c7879959ec874 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 21 Oct 2021 15:51:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=B0=8F=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/gameFuncs.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/parts/gameFuncs.lua b/parts/gameFuncs.lua index 405adc43..9225c7a6 100644 --- a/parts/gameFuncs.lua +++ b/parts/gameFuncs.lua @@ -6,6 +6,7 @@ local gc_setShader=gc.setShader local gc_draw,gc_rectangle,gc_line,gc_printf=gc.draw,gc.rectangle,gc.line,gc.printf local ins,rem=table.insert,table.remove +local rnd=math.random local SETTING,GAME,SCR=SETTING,GAME,SCR local PLAYERS=PLAYERS @@ -80,7 +81,6 @@ end --Royale mode function randomTarget(P)--Return a random opponent for P - local rnd=math.random if #PLY_ALIVE>1 then local R repeat @@ -179,6 +179,13 @@ end --Game +function coin(a,b) + if rnd()<.5 then + return a + else + return b + end +end function generateLine(hole) return 1023-2^(hole-1) end