Wildtalents/Godlike One-roll system

Simulated dice for role playing games
Post Reply
bloodfang
Honored
Posts: 83
Joined: Wed Dec 31, 2008 7:43 am

Wildtalents/Godlike One-roll system

Post by bloodfang » Wed Dec 31, 2008 7:54 am

Any support for this system, the the dice get orginized into matched sets?

For example, you roll 10d10 and if you got a roll of 2,2,3,4,5,8,4,7,8,4, have it orginized into
8 x2
7
4 x3
3
2 x2

gandreas
Immortal
Posts: 1464
Joined: Wed Feb 04, 2004 6:02 pm
Contact:

Post by gandreas » Wed Dec 31, 2008 11:11 am

There is some support for this via the match() function, though it only reports the "widest" match. So if you do

Code: Select all

match(10d10@)
it will (if the roll was 2,2,3,4,5,8,4,7,8,4) report "3,4" (3 fours)

shouit
Posts: 1
Joined: Tue Mar 10, 2009 9:04 am

Post by shouit » Tue Mar 10, 2009 8:09 pm

Was wondering about support for multiple sets in any coming version?

Zelannii
Posts: 9
Joined: Tue Mar 10, 2009 2:01 pm

Post by Zelannii » Mon Mar 23, 2009 10:36 am

The sort function will at least return the values in numerical order.

2,2,3,4,4,4,5,7,8,8.

A more complicated method would be to use lists, and the eq# function repeated several times (for each vanue of the die rolled) within nested if statements, concatenating the results to display on screen. It would be ugly, but with the web editor now availible it should not be that bad...

gandreas
Immortal
Posts: 1464
Joined: Wed Feb 04, 2004 6:02 pm
Contact:

Re: Wildtalents/Godlike One-roll system

Post by gandreas » Mon Jul 27, 2009 3:37 pm

2.1 will finally have support to resolve this - via the new unique() and uniquec() functions and some minor tweaks in sort().

Code: Select all

@1 <- 10d8@.
sort(uniquec(@1) + "x" + unique(@1))
So unique() takes a list, and returns the unique items in (sorted). So 2,2,3,4,5,8,4,7,8,4 will return (2,3,4,5,7,8). uniquec() take the list and returns how many of each of the elements returned by unique(). So this will spit out (2,1,3,1,1,2).

Adding a list + string will add that string to each element of the list, so uniquec(@1) + "x" is ("2x","1x","3x","1x","1x","2x"). Add in the list unique(@1) and you get ("2x2","1x3","3x4","1x5","1x7","2x8"). Finish by sorting it, and it'll print out:

3x4, 2x8, 2x2, 1x7, 1x5, 1x3

Post Reply