Article View: pl.comp.lang.ruby
Article #1210Re: rozrzucić
From: Bronisław Tatul
Date: Wed, 18 Feb 2009 13:38
Date: Wed, 18 Feb 2009 13:38
19 lines
1393 bytes
1393 bytes
Radosław Bułat pisze:
> Od Bronisław Tatul pisze:
>> Mam pytanie. Jak rozrzucic losowo elementy w tablicy.
[....]
> arr = (1..10).to_a
> arr.shuffle!
ten wykrzyknik coś daje?
> Wcześniej:
>
> arr = (1..10).to_a
> arr = arr.sort_by { rand }
Bardzo dziękuję.
Ciekawe czy jest coś takiego jak receptury dla ruby.
No to chyba jednak nastepny kawałek bedę juz pisał w ruby ;-)
Technical Details
Message-ID:
<gnh2lk$oen$1@atlantis.news.neostrada.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!wsisiz.edu.pl!newsfeed.neostrada.pl!nemesis.news.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mailReferences:
<gngc3r$t4t$1@atlantis.news.neostrada.pl> <gngr0v$eu$1@inews.gazeta.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!wsisiz.edu.pl!newsfeed.neostrada.pl!nemesis.news.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail From: Bronisław Tatul <TaaatulBroni5@pocztaWYTNIJTO.taatul.eu> Newsgroups: pl.comp.lang.ruby Subject: Re: rozrzucić Date: Wed, 18 Feb 2009 13:38:18 +0000 Organization: Super Sprzedawca Allegro Lines: 19 Message-ID: <gnh2lk$oen$1@atlantis.news.neostrada.pl> References: <gngc3r$t4t$1@atlantis.news.neostrada.pl> <gngr0v$eu$1@inews.gazeta.pl> NNTP-Posting-Host: acmm5.neoplus.adsl.tpnet.pl Mime-Version: 1.0 X-Trace: atlantis.news.neostrada.pl 1234963959 25047 83.10.140.5 (18 Feb 2009 13:32:39 GMT) X-Complaints-To: usenet@news.neostrada.pl NNTP-Posting-Date: Wed, 18 Feb 2009 13:32:39 +0000 (UTC) User-Agent: Thunderbird 2.0.0.6 (X11/20070728) In-Reply-To: <gngr0v$eu$1@inews.gazeta.pl> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit