FAQ
<bikeshead>
return round 1 + rand * $!sides;

Might be good to refer to http://perlcabal.org/syn/S32/Containers.html
for a more idiomatic way of picking an integer, eg "return
(1..$sides).pick"

A "roll" method was just added, though I don't think its implemented
yet. If you're only getting one value then "pick" and "roll" are the
same.

</bikeshead>
-y

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 4 | next ›
Discussion Overview
groupperl6-users @
categoriesperl
postedSep 18, '10 at 2:15p
activeSep 18, '10 at 9:35p
posts4
users3
websiteperl6.org

3 users in discussion

Moritz Lenz: 2 posts Phil Crow: 1 post Yary: 1 post

People

Translate

site design / logo © 2021 Grokbase