Issue #4147 has been updated by Yui NARUSE.

Target version set to 2.0.0

????????????荐???c?<????c???紊т??紊??????????????с????????????????筝?????????若?鴻?宴?若?鴻?c??RPG??????若??с?????????
http://tkool.jp/
http://d.hatena.ne.jp/ktakaki/20111201/p1

???????荅宴????冴????ゃ?ゃ??ping
----------------------------------------
Feature #4147: Array#sample ??ч????帥?????絎??????????
http://redmine.ruby-lang.org/issues/4147

Author: Yoji Ojima
Status: Assigned
Priority: Normal
Assignee: Shyouhei Urabe
Category: 
Target version: 2.0.0


=begin
 Array#sample ????????????羝<???????????????????????祉????ゃ??荀?膣???????帥?????篏????????????????????с??????????????
 
 筝?荐????泣?潟?????с??"紊у??" ??? "???" ??? 1000 ?????腆?????ч?御?????????????????????????????с?????
 
 omikuji_box = [
   {:name => "紊у??", :weight => 1000},
   {:name => "筝??", :weight => 100},
   {:name => "絨???", :weight => 10},
   {:name => "???",   :weight => 1}
 ]
 omikuji = omikuji_box.sample {|v| v[:weight] }
 puts omikuji[:name]
=end



-- 
http://redmine.ruby-lang.org