rand(x), array.rand

rand(x):

rand(x) #liefert eine Zufallszahl (float) < x

array.rand:
Anmerkung: array.rand ist eine Ruby on Rails-Erweiterung.

array = ["a","b","c","d","e"]
random_letter = array.rand #random_letter beinhaltet 
                           #einen Buchstaben (a-e)
This entry was posted in tricks. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Security Code: