Class: BCDice::DiceTable::D66LeftRangeTable
- Defined in:
- lib/bcdice/dice_table/d66_left_range_table.rb
Overview
左側(十の位)のみ Range を用いる D66 表
Instance Method Summary collapse
-
#initialize(name, sort_type, items) ⇒ D66LeftRangeTable
constructor
A new instance of D66LeftRangeTable.
Methods inherited from D66Table
Constructor Details
#initialize(name, sort_type, items) ⇒ D66LeftRangeTable
Returns a new instance of D66LeftRangeTable.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/bcdice/dice_table/d66_left_range_table.rb', line 12 def initialize(name, sort_type, items) = {} items.each do |item| range, right_items = item range.each do |left_value| right_items.each_with_index do |right_item, right_value| key = left_value * 10 + (right_value + 1) [key] = right_item end end end super(name, sort_type, ) end |