9 lines
330 B
Luau
9 lines
330 B
Luau
--!strict
|
|
return function(credit: any)
|
|
assert(credit.advance(0, 1, 0, .8, 1, false) == 1)
|
|
assert(credit.advance(0, 1, 0, .8, 1.5, false) == 1.5)
|
|
assert(credit.advance(4, 2, 0, .8, 1, true) == 4)
|
|
assert(credit.advance(.1, 1, .75, .8, 1, true) == 0)
|
|
assert(math.abs(credit.advance(1, 1, .5, .8, 1.5, false) - 1.35) < 1e-6)
|
|
end
|