RoloLudo/RoloLudo.package/SfTruth.class/instance/refineOptionIntervals.st

13 lines
309 B
Smalltalk

accessing
refineOptionIntervals
| endings |
endings := self options collect: [:opt | opt chance ].
endings doWithIndex: [:end :i |
(i = 1)
ifTrue: [(self options at: i) chance: (1 to: end)]
ifFalse: [
(self options at: i) chance: (((endings at: (i-1)) + 1) to: (endings at: i))
]
].