Card suits and initialization.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-11-14 10:42:46 -05:00
parent dd5bf4cb33
commit 63c68c7232
5 changed files with 19 additions and 2 deletions

View File

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

View File

@ -2,3 +2,8 @@ accessing
initialize initialize
| response | | response |
response := self new. response := self new.
self suits do: [:suit |
self numeralCards do: [:number|
response cards add: number asString, suit.
]
].

View File

@ -0,0 +1,3 @@
accessing
numeralCards
^ 1 to: 10

View File

@ -1,3 +1,6 @@
accessing accessing
suits suits
^ #('clubs ♣' 'diamons ♦' 'hearts ♥' 'spades ♠') ^ { '♣' -> 'clubs' .
'♦' -> 'diamons' .
'♥' ->'hearts' .
'♠' ->'spades'} asDictionary

View File

@ -0,0 +1,3 @@
accessing
cards
^ cards