AnyDice code for rolling pools of dice, ignoring all 6s, and adding up the remainder; whoever rolls highest wins

I'm trying to ascertain the probabilities of the following pool system. If anyone could crunch some numbers in AnyDice so much the better.

Two opponents roll a pool of d6. These pools vary from 1-10. Both pools ignore all 6s and add up all the remaining dice. Whoever rolls highest wins. With ties, victory goes to the defender or target of the action.

Example 1

Josh wants to seduce Mary. His Charm is 3. Mary is just resisting with her Mind of 4. Josh rolls 1, 4 and 6. Ignoring the 6, Josh adds 1 and 4 totalling 5. Mary rolls 3, 1, 2 and 6. Ignoring the 6, Mary adds 3, 1 and 2 for a total of 6.

Josh 5 vs Mary 6, she successfully resists.

Example 2

Troy wants to sneak by a bunch of zombies. He rolls his Dexterity 4 vs the zombies' Mind 2. Troy rolls 1, 4, 6 and 4. He ignores the 6, adds the rest for a total of 9. The zombies roll 5 and 3 for a total of 8.

Troy sneaks by the zombies undetected.

Here is an anydice program that should do that.

D: {1,2,3,4,5,0}

loop N over {1..10}{
loop M over {1..10}{
output NdD - MdD > 0 named " Attacker [N] vs Defender [M]"
}
}


This redfines the 6 on the die to count as zero.

I had no good way to summarize the output across this huge matrix, but thanks to @Ilmari Karonen there is a nice script for it in his answer here. Here is the output, the percentage is the chance of the attacker to win:

The more dice you use, the more they average out and the same number of dice on both sides gets closer to 50%, but of course, as overall ties win for the defender the attacker never quite gets to 50% in those cases.

The chances for the side with fewer dice go down pretty quickly.

• For summarizing the results, the method from rpg.stackexchange.com/questions/144360/… might be useful. Commented Oct 12, 2023 at 17:37
• @IlmariKaronen Thanks a lot, that worked wonderfully. Commented Oct 12, 2023 at 19:09