Click to See Complete Forum and Search --> : Python question


brento73
10-19-2002, 02:04 AM
I'm working on a dice script, and I've hit a snag. I can generate virtual rolls all day, but what I want to do is ignore the lowest(or lowest several) dice before adding the rest to get a total number.

To be more specific(and display my cross-environment geekishness), I'm wanting to generate 4d6, discarding the lowest die. That's stat generation for D&D, by the way. I've looked around and can't figure out how to get it to ignore the lowest die without MASSIVE brute force code. There's got to be a simpler way to do this.

Thanks in advance

X_console
10-19-2002, 10:02 AM
Why don't you store all the results into an array and then from there just find out which one is the smallest and ignore it?