Hi,
Just to make sure I have the precedence and so on right, I used a loaded dice that always rolls it's number of sides to write some tests. Since there's been some discussion over the precedence rules, I'll post them to maybe compare with others and see if I'm on the right track. Hope that's within the rules? I've left out broken input ones, since at the moment mine just 'does it's best' but I might tighten that up yet...
@asserts = {
'1' => 1,
'1+2' => 3,
'1+3*4' => 13,
'1*2+4/8-1' => 1,
'd1' => 1,
'1d1' => 1,
'd10' => 10,
'1d10' => 10,
'10d10' => 100,
'd3*2' => 6,
'5d6d7' => 210, # left assoc
'2d3+8' => 14, # not 22
'(2d(3+8))' => 22, # not 14
'd3+d3' => 6,
'd2*2d4' => 16,
'd(2*2)+d4' => 8,
'd%' => 100,
'2d%' => 200,
'14+3*10d2' => 74,
'(5d5-4)d(16/d4)+3' => 87, #25d4 + 3
}
Cheers.
···
--
Ross Bamford - rosco@roscopeco.remove.co.uk
Feel free to summarize here, but I generally don't add the discussion to the quizzes themselves. I like to keep them pretty basic an we can always go to the archives as needed, I figure.
I did correct the error on the site though. 
James Edward Gray II
···
On Jan 6, 2006, at 9:26 PM, J. Ryan Sobol wrote:
Thank you all for pitching in your explanation of dice rollers to non-D&D players like my self. However, there's a considerable amount of noise for this post (already) and I'm not 100% confident I could parse the dice syntax in English let alone ruby. Would it be possible to summarize this discussion and post it as an addendum at Ruby Quiz - Dice Roller (#61) ?
I really love this mailing list.
It's simple and with threaded view it's perfect.
But sometimes a forum with an edit function is handy too :>
"Ross Bamford" <rosco@roscopeco.remove.co.uk> writes:
Hi,
Just to make sure I have the precedence and so on right, I used a
loaded dice that always rolls it's number of sides to write some
tests. Since there's been some discussion over the precedence rules,
I'll post them to maybe compare with others and see if I'm on the
right track. Hope that's within the rules? I've left out broken input
ones, since at the moment mine just 'does it's best' but I might
tighten that up yet...
@asserts = {
...
'(5d5-4)d(16/d4)+3' => 87, #25d4 + 3
}
This is wrong, the maximum is 339: (25-4)d(16/1)+3.
···
Ross Bamford - rosco@roscopeco.remove.co.uk
--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org
I don't understand that. I get:
(5d5-4)d(16/d4)+3 = 87
(5d5-4)d(16/d1)+3 = 339
I read the first as 21 rolls (25 - 4) of a four sided (16 / 4) dice plus 3, while the second is 21 rolls (25 - 4) of a 16 sided (16 / 1) dice, plus 3.
Right?
···
On Sat, 07 Jan 2006 12:27:05 -0000, Christian Neukirchen <chneukirchen@gmail.com> wrote:
"Ross Bamford" <rosco@roscopeco.remove.co.uk> writes:
Hi,
Just to make sure I have the precedence and so on right, I used a
loaded dice that always rolls it's number of sides to write some
tests. Since there's been some discussion over the precedence rules,
I'll post them to maybe compare with others and see if I'm on the
right track. Hope that's within the rules? I've left out broken input
ones, since at the moment mine just 'does it's best' but I might
tighten that up yet...
@asserts = {
..
'(5d5-4)d(16/d4)+3' => 87, #25d4 + 3
}
This is wrong, the maximum is 339: (25-4)d(16/1)+3.
Ross Bamford - rosco@roscopeco.remove.co.uk
--
Ross Bamford - rosco@roscopeco.remove.co.uk
I don't understand that. I get:
(5d5-4)d(16/d4)+3 = 87
(5d5-4)d(16/d1)+3 = 339
I read the first as 21 rolls (25 - 4) of a four sided (16 / 4) dice plus 3, while the second is 21 rolls (25 - 4) of a 16 sided (16 / 1) dice, plus 3.
Right?
(5d5-4)d(16/d4)+3
(5d5-4) is 25 at max
(16/d4) is 16 at max
25d16+3 is 339 at max
qed
"Ross Bamford" <rosco@roscopeco.remove.co.uk> writes:
"Ross Bamford" <rosco@roscopeco.remove.co.uk> writes:
Hi,
Just to make sure I have the precedence and so on right, I used a
loaded dice that always rolls it's number of sides to write some
tests. Since there's been some discussion over the precedence rules,
I'll post them to maybe compare with others and see if I'm on the
right track. Hope that's within the rules? I've left out broken input
ones, since at the moment mine just 'does it's best' but I might
tighten that up yet...
@asserts = {
..
'(5d5-4)d(16/d4)+3' => 87, #25d4 + 3
}
This is wrong, the maximum is 339: (25-4)d(16/1)+3.
Ross Bamford - rosco@roscopeco.remove.co.uk
I don't understand that. I get:
(5d5-4)d(16/d4)+3 = 87
(5d5-4)d(16/d1)+3 = 339
I read the first as 21 rolls (25 - 4) of a four sided (16 / 4) dice
plus 3, while the second is 21 rolls (25 - 4) of a 16 sided (16 / 1)
dice, plus 3.
Right?
Yeah. I got your list wrong then, I thought the number means the
maximum reachable, not what to throw with loaded dice. Sorry.
···
On Sat, 07 Jan 2006 12:27:05 -0000, Christian Neukirchen > <chneukirchen@gmail.com> wrote:
Ross Bamford - rosco@roscopeco.remove.co.uk
--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org
Robert Retzbach schrieb:
I don't understand that. I get:
(5d5-4)d(16/d4)+3 = 87
(5d5-4)d(16/d1)+3 = 339
I read the first as 21 rolls (25 - 4) of a four sided (16 / 4) dice plus 3, while the second is 21 rolls (25 - 4) of a 16 sided (16 / 1) dice, plus 3.
Right?
(5d5-4)d(16/d4)+3
(5d5-4) is 25 at max
(16/d4) is 16 at max
25d16+3 is 339 at max
qed
Ignore me for lifetime please.
Oh, I see. I guess it's a standard thing to do to find the maximum? As I say I'm a rank amateur when it comes to dice so I apologise if I've gone against the normal way to do things.
I just wanted to be able to predict the result of the expressions, so I could calculate the expected result to test the operator precedence rules. With the loaded dice, 5d5 is effectively a (higher-precedence) 5*5. Hope it doesn't cause confusion.
···
On Sat, 07 Jan 2006 13:51:51 -0000, Christian Neukirchen <chneukirchen@gmail.com> wrote:
"Ross Bamford" <rosco@roscopeco.remove.co.uk> writes:
On Sat, 07 Jan 2006 12:27:05 -0000, Christian Neukirchen >> <chneukirchen@gmail.com> wrote:
"Ross Bamford" <rosco@roscopeco.remove.co.uk> writes:
Hi,
Just to make sure I have the precedence and so on right, I used a
loaded dice that always rolls it's number of sides to write some
tests. Since there's been some discussion over the precedence rules,
I'll post them to maybe compare with others and see if I'm on the
right track. Hope that's within the rules? I've left out broken input
ones, since at the moment mine just 'does it's best' but I might
tighten that up yet...
@asserts = {
..
'(5d5-4)d(16/d4)+3' => 87, #25d4 + 3
}
This is wrong, the maximum is 339: (25-4)d(16/1)+3.
I don't understand that. I get:
(5d5-4)d(16/d4)+3 = 87
(5d5-4)d(16/d1)+3 = 339
I read the first as 21 rolls (25 - 4) of a four sided (16 / 4) dice
plus 3, while the second is 21 rolls (25 - 4) of a 16 sided (16 / 1)
dice, plus 3.
Right?
Yeah. I got your list wrong then, I thought the number means the
maximum reachable, not what to throw with loaded dice. Sorry.
--
Ross Bamford - rosco@roscopeco.remove.co.uk