# Help with Anydice function for 3d10 dice pool

I'd like to see the probability distribution for 3d10 being rolled, where the highest number is positive, the lowest (closest to 1) is negative, and the middle die is ignored. (As a way of providing "advantage" dice in a 2d10 over/under die rolling mechanic.) I've tried to look into programming it myself in Anydice but can't seem to get it to work.

Thanks!

If you want to subtract the lowest of the 3d10 from the highest, use this:

function: xx A:s xx {
result:1@A - 3@A
}
output [xx 3d10 xx]