I wrote a python script way back when (sometime last edition) to do that, and handle possible melee outcomes for a given initiative order. Of course, I got frustrated trying to get it to calculate it properly, and so just made it simulate a few hundred thousand instances of combat and record the result, spitting out how often a given result turned up.
The to wound target number is 4+T-S, to a minimum of 2, with 7 counting as 6; higher numbers don't appear on a d6, and so can be ignored. For high BS scores, you have to factor in a reroll on a 1, with a new target number. For vehicles you have to use a completely different set of rules; it's not hard to do, just a lot more work. How to actually do any of this in whatever language you're using, and with whatever style of probability calculation (I can't tell you how to do anything but brute force simulation, personally (true story, I wrote a little script to run out the possible rolls for 2d6 and neatly present the percentage likelihood for any given result, because I was too tired to figure it out myself a few days ago)) you're going with, I can't say. I don't really know what all's changed with the new edition either, I never got around to more than skimming the rules, mostly play blood bowl these days.
|