Ok, I am terrible at the formulas, but I have managed to figure out the basics of what I want but... for the bigger rolls theres one more step I would like.

So far I have this

sort (20d10@)

this formula rolls 20d10 and then gives me the numbers sorted from low to high...

so for example the result looks like this

1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 5, 5, 5, 7, 7, 8, 8, 10

but what I actually want the result to look like is this

3x1

5x2

3x3

1x4

3x5

2x7

2x8

1x10

is there any way I can do that?

Thanks for any help people can give, I appreciate it...

Neil

## Dice Formula

### Re: Dice Formula

The need for something like this has been anticipated, so doing this is pretty compact:
unique() finds all the unique values in a list. uniquec() is similar, but find the corresponding counts of those unique values.

The magic is then in the last line - adding a value to a list results in adding that value to each element of the list, producing a new list (@c + " x " creates a new list with each element in @c with the string " x " appended to it). Adding two lists will add each element in the list ("pair wise"), producing a new list.

You could even shorten this to:

Code: Select all

```
@x <- 20d10@.
@v <- unique(@x).
@c <- uniquec(@x).
@c + " x " + @v
```

The magic is then in the last line - adding a value to a list results in adding that value to each element of the list, producing a new list (@c + " x " creates a new list with each element in @c with the string " x " appended to it). Adding two lists will add each element in the list ("pair wise"), producing a new list.

You could even shorten this to:

Code: Select all

```
@x <- 20d10@.
@uniquec(@x) + " x " + @unique(@x)
```