Issue #4147 has been updated by akr (Akira Tanaka).


?????冴????若????c?潟?違?ц????????????????篏????絎?茖?????????違?????????篁?罕?????????障?蚊??ゃ??c????????????????????
?????ч?蚊?障????????????????????眼??荀???障????????

????????????????腱?????repeat: ??????激?с?潟????????????????????帥??絎?茖????????????????????с???????????????????障?????

????????с???????????????????????ゃ?絲???????????帥??菴??????????????障?????鐚?膣??腆榊????с????????障?????鐚?

鐚?膣??腆榊???????????????????????帥??鴻?????膣???с?????????????????????????????????
???????????????筝???????????????帥?茹??????????????宴?с?????
??????膣??腆榊?????綽?荀????????絨???ョ??????????????激?с?喝????違?ф??絎???????????????????????????障?????鐚?
----------------------------------------
Feature #4147: Array#sample ??ч????帥?????絎??????????
https://bugs.ruby-lang.org/issues/4147#change-28017

Author: oj (Yoji Ojima)
Status: Assigned
Priority: Normal
Assignee: shyouhei (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://bugs.ruby-lang.org/