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
For your YouTube comment section. (updated)
Hello 2
Hand positions in a circle
ok
Hakusu
Surface Area of things (Incomplete)
CC: LDInterface
bf-asm compiler test 2
Percentage Calculator (Subscribe to Madflag19)
10 Line challenge