Module:Blackjack stun calculator: Revision history

Jump to navigation Jump to search
Diff selection: mark the radio boxes of the versions to compare or click on a revision date to view it. (cur) = difference from current version, (prev) = difference from preceding version,  m = minor edit, → = section edit

17 October 2024

  • curprev 00:0000:00, 17 October 2024Alex talk contribs 656 bytes +656 Created page with "local p = {} function p.main(frame) local args = frame:getParent().args return p.calculate(tonumber(args.max_hit), tonumber(args.hitpoints)) end function p.calculate(max_hit, hitpoints) local chance = 0.0 for hit = 0,max_hit do if hit > hitpoints then chance = chance + (2*hit-hitpoints)/(2*hit+2)/(1+max_hit) else chance = chance + hit/(2*hitpoints+2)/(1+max_hit) end end return "On a successful hit, the stun chance with a max hit of '''" .. tos..."