Card suits and initialization finished.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-11-14 11:21:21 -05:00
parent 63c68c7232
commit edfe4740b8
4 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,3 @@
accessing accessing
faceCards faceCards
^ #( $J $Q $K) ^ #( 'J' 'Q' 'K')

View File

@ -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

View File

@ -1,3 +1,3 @@
accessing accessing
cards cards
^ cards ^ cards ifNil: [ cards := OrderedCollection new]

View File

@ -0,0 +1,4 @@
accessing
printOn: aStream
super initialize.
^ aStream nextPutAll: self cards printString