RoloLudo/RoloLudo.package/DicePool.class/instance/uiDiceFor..st

14 lines
407 B
Smalltalk
Raw Normal View History

2023-12-03 22:40:36 +00:00
accessing
uiDiceFor: aView
<gtView>
| response currentRoll dicePool |
2023-12-03 22:40:36 +00:00
response := '' writeStream.
currentRoll := self roll.
dicePool := self dice collect: [:each | each faces ].
2023-12-03 22:40:36 +00:00
response
nextPutAll: 'Dice: ', dicePool printString ; cr;
nextPutAll: 'Roll: ', currentRoll printString; cr;
nextPutAll: 'Sum: ', currentRoll sum asString.
2023-12-03 22:40:36 +00:00
^ aView text
title: 'Dice';
text: [ response contents ]