Dice Roller

Hi, here is my solution… I don’t know if it handles every case right,
but it was fun to write… :wink:

By the way, does someone of you know what became of rockit
http://rockit.sourceforge.net/ - it would’ve been very handy for this
quiz, but I could not get it to work somehow…

But here’s the code:

class Integer;def d(v)r=0;times{r+=1+rand(v)};r;end;end;x,y=
)/x){$1==""? “.d”: “.d(#$1)”};puts (“1”…y).map{eval e}" "

(Sorry… I just had to… ;))

Stefan W.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs