From: Lloyd Linklater Date: 2007-11-28T22:10:36+09:00 Subject: Re: Most elegant way to do this? William James wrote: > That C-code is hideous. Let's compare it to something > that isn't insanely low-level. OOOOO! I know this one! If you meant this as pascal, this is the code: function roll( n: integer ): integer; var i: integer; begin for i := 1 to n do result := inc(result, random(6) + 1); end; There is no += in pascal. If only... :) Your version where you init the result so you do not have to add may run faster but I golfed it a bit. Still, it is far better than the C version. I liked seeing it here too. :) -- Posted via http://www.ruby-forum.com/.