Karma Posted April 3, 2005 Posted April 3, 2005 Hi, I am trying to make a dice roller, but have had no luck in working out how. I need to be able to roll any number of dice. I need to be able to choose the size of the dice - 4, 6, 8, 10, 12, 20 I need to be able to modify the dice rolls - remove lowest; remove 2 lowest, remove highest & lowest, or no modify. Can anyone help me?? (i found one post using a recursion? but i didn't understand it.) Thanks in advance
Zero Tolerence Posted April 4, 2005 Posted April 4, 2005 Sure thing. Here is your roller, It inputs the results into a single Return Delimeted field. They results should be easy to minuplate like that. Two pull down menu's let you choose the # of dice to roll, and the # of sides each dice has. DiceRoller.zip
Karma Posted April 4, 2005 Author Posted April 4, 2005 Ok... this is good... But how would i go about the last part of my question? How do i say, remove the lowest number from the result? And how would i add them up?
Zero Tolerence Posted April 11, 2005 Posted April 11, 2005 Use a script, create a variable, or use the current one, dump the first line into it. If its < the 2nd line, leave it there. Loop that as many times as you have dice. and it will give you the lowest number, remove or sub that from the results field. If you want to remove the lowest two, loop it twice. I'm sure there is a way to do this with a recursive function, but at the moment its beyond me how you would remove it.
Recommended Posts
This topic is 7169 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now