“Can you share your serial key with us so that we can check the properties of the key and do the needful to you.”
by Skelta Support http://www.skelta.com/

Snippet: Die Roll

This snippet replaces instances of #d# in a text block with random numbers generated similarly to table-top gaming dice rolls. The random numbers are generated the same way that a die would be rolled in this situation (e.g. “3d6″ equates to “roll random 1 to 6 three times; add all three rolls”).

Click here to download the snippet: Die Roll

Sample Input:
I have a +1d3 Ring of Codefu, but I may be inclined to part with it for say… 3d20 gold? Hmmm…

Sample Output:
I have a +3 Ring of Codefu, but I may be inclined to part with it for say… 13 gold? Hmmm…

One Response to “Snippet: Die Roll”

  • Isabel Denassi – OH MY GOD WELCOME TO THE MARRIAGE CLUB! WE ARE SO EXCITED FOR YOU TWO THAT I’M TYPING IN ALL CAPITALS. Actually you’re almost in the maiarrge club, but the engagement club is awesome too! Congratulations to you both, you guys are such an inspiration to us.

    Thumb up Thumb down 0

Leave a Reply

Tags
Get a free book about code review best practices.