Card suits and initialization finished.
This commit is contained in:
parent
63c68c7232
commit
edfe4740b8
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
faceCards
|
||||
^ #( $J $Q $K)
|
||||
^ #( 'J' 'Q' 'K')
|
@ -2,8 +2,9 @@ accessing
|
||||
initialize
|
||||
| response |
|
||||
response := self new.
|
||||
self suits do: [:suit |
|
||||
self numeralCards do: [:number|
|
||||
self suits keysDo: [:suit |
|
||||
(self numeralCards, self faceCards) do: [:number|
|
||||
response cards add: number asString, suit.
|
||||
]
|
||||
].
|
||||
].
|
||||
].
|
||||
^ response
|
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
cards
|
||||
^ cards
|
||||
^ cards ifNil: [ cards := OrderedCollection new]
|
4
RoloLudo.package/DeckOfCards.class/instance/printOn..st
Normal file
4
RoloLudo.package/DeckOfCards.class/instance/printOn..st
Normal file
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
printOn: aStream
|
||||
super initialize.
|
||||
^ aStream nextPutAll: self cards printString
|
Loading…
Reference in New Issue
Block a user