Sha256: 5e51eafb042a00a0e205f06451c42b107c32c2563ac1ccb088eeda1d15f4ca02
Contents?: true
Size: 554 Bytes
Versions: 84
Compression:
Stored size: 554 Bytes
Contents
# encoding: utf-8 # Numeric class Numeric # dice number mappings DICE = { 1 => 6, 2 => 5, 3 => 4, 4 => 3, 5 => 2, 6 => 1 } # return dice back number # # ==== Examples # # each 1-6 case # # 1.dice_back # => return 6 # 2.dice_back # => return 5 # 3.dice_back # => return 4 # 4.dice_back # => return 3 # 5.dice_back # => return 2 # 6.dice_back # => return 1 # # other case # # 7.dice_back # => return 7 # def dice_back DICE.include?(self) ? DICE[self] : self end end
Version data entries
84 entries across 84 versions & 1 rubygems