Help with mathswing project

By malladin.ben, in X-Wing

I've been meaning to turn this into a proper github repo with tests and the like (pretty sure this is the working version), but in the meantime:

https://gist.github.com/wickedgrey/9fbcffb3f33e26eb475c

This approach is A) exact, B) fast, C) decomposed into functions, and D) doesn't require any math(s) beyond basic high school. It does require understanding recursion, but that's about it. Comments and constructive criticism welcome.

Note that it expects python2.7, as that's what I use at work.

If your degree of accuracy is finer than .01 damage it's too small to matter. Hell, everything past about .1 damage is irrelevent.

Or you can get the exact answer as explained above by Vorpal and I, which takes less computational power by several orders of magnitude.

Indeed.