RoloLudo/RoloLudo.package/DeckOfCards.class/instance/printOn..st

12 lines
333 B
Smalltalk

accessing
printOn: aStream
super initialize.
aStream nextPutAll: 'Stock: ', String cr.
self class suits keysDo: [ :suit |
aStream
nextPutAll: (self stockCardsInSuit: suit);
nextPutAll: String cr.
].
aStream nextPutAll: 'Drawn: ', String cr.
self drawn do: [:card | aStream nextPutAll: card, ' ' ].
^ aStream contents.