Category Archives: tricks

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)

Posted in tricks | Leave a comment