<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gan2</author_name>
  <author_url>https://blog.hatena.ne.jp/gan2/</author_url>
  <blog_title>gan2 の Ruby 勉強日記</blog_title>
  <blog_url>https://gan2-2.hatenadiary.org/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>sort_by と rand を使ってこんな風にできる。へーへー。 ary = (1..100).to_a ary2 = ary.sort_by{|i| rand } p ary2 ちなみに上のやつを見る前に僕が自分で考えて書いたのがこれ。 ary = (1..100).to_a ary2 = Array.new while ary.size &gt; 0 ary2 &lt;&lt; ary.slice!(rand(ary.size)) end p ary2 もちろんこれでもいいわけだけど、 さっきのやつの方がキレイでカッコイイ。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgan2-2.hatenadiary.org%2Fentry%2F20070519%2F1179549752&quot; title=&quot; 配列の中身をランダムに並び替える - gan2 の Ruby 勉強日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2007-05-19 13:42:32</published>
  <title> 配列の中身をランダムに並び替える</title>
  <type>rich</type>
  <url>https://gan2-2.hatenadiary.org/entry/20070519/1179549752</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
