Card suits and initialization finished.
This commit is contained in:
parent
63c68c7232
commit
edfe4740b8
@ -1,3 +1,3 @@
|
|||||||
accessing
|
accessing
|
||||||
faceCards
|
faceCards
|
||||||
^ #( $J $Q $K)
|
^ #( 'J' 'Q' 'K')
|
@ -2,8 +2,9 @@ accessing
|
|||||||
initialize
|
initialize
|
||||||
| response |
|
| response |
|
||||||
response := self new.
|
response := self new.
|
||||||
self suits do: [:suit |
|
self suits keysDo: [:suit |
|
||||||
self numeralCards do: [:number|
|
(self numeralCards, self faceCards) do: [:number|
|
||||||
response cards add: number asString, suit.
|
response cards add: number asString, suit.
|
||||||
]
|
|
||||||
].
|
].
|
||||||
|
].
|
||||||
|
^ response
|
@ -1,3 +1,3 @@
|
|||||||
accessing
|
accessing
|
||||||
cards
|
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