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
Eliminatoria minigame
Lua Obfuscator loadstring method by
Frequency distribution of rolling a certain number on xDy
Kegs Scores ... FOOOOOOTBALLLLLL
as
855
1
cumulative probability
kraft1c
example for a friend