Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
test3
local health = 50 local maxHP = 100 local hp_diff = (maxHP - health) local reps = math.max(1, math.floor(hp_diff / 10)) local inc_hp = math.ceil(hp_diff / 2) print(reps, inc_hp) function math.Approach( cur, target, inc ) inc = math.abs( inc ) if ( cur < target ) then return math.min( cur + inc, target ) elseif ( cur > target ) then return math.max( cur - inc, target ) end return target end for k = 1, reps do health = math.Approach(health, maxHP, inc_hp) end print(health)
run
|
edit
|
history
|
help
-1
BasicTablePrinterV2
Personal Use (Among Us)
Random Item Generator (1 year)
dd
PAID HACK PuBG
Conta valores acima da média - LUA
True every 5
lua5.3: ...Desktop/rextester_linux_2.0/usercode/68368288/source.lua:166: unexpected symbol near '}'
Find primes until e
Newton-Raphson method for the square root