-- D'Alembert (flat progression)
-- Add one unit after a loss, remove one unit after a win, never below the base bet.
-- Far gentler than martingale: the bet grows linearly instead of exponentially, so it
-- survives long streaks at the cost of slower recovery.

chance  = 49.5
bethigh = false

basebet = params.basebet or balance / 5000
nextbet = basebet

local unit = params.unit or basebet   -- step size

function dobet()
  if win then
    nextbet = math.max(basebet, previousbet - unit)
  else
    nextbet = previousbet + unit
  end
end
