Card suits and initialization.
This commit is contained in:
parent
dd5bf4cb33
commit
63c68c7232
3
RoloLudo.package/DeckOfCards.class/class/faceCards.st
Normal file
3
RoloLudo.package/DeckOfCards.class/class/faceCards.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
faceCards
|
||||
^ #( $J $Q $K)
|
@ -2,3 +2,8 @@ accessing
|
||||
initialize
|
||||
| response |
|
||||
response := self new.
|
||||
self suits do: [:suit |
|
||||
self numeralCards do: [:number|
|
||||
response cards add: number asString, suit.
|
||||
]
|
||||
].
|
3
RoloLudo.package/DeckOfCards.class/class/numeralCards.st
Normal file
3
RoloLudo.package/DeckOfCards.class/class/numeralCards.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
numeralCards
|
||||
^ 1 to: 10
|
@ -1,3 +1,6 @@
|
||||
accessing
|
||||
suits
|
||||
^ #('clubs ♣' 'diamons ♦' 'hearts ♥' 'spades ♠')
|
||||
^ { '♣' -> 'clubs' .
|
||||
'♦' -> 'diamons' .
|
||||
'♥' ->'hearts' .
|
||||
'♠' ->'spades'} asDictionary
|
3
RoloLudo.package/DeckOfCards.class/instance/cards.st
Normal file
3
RoloLudo.package/DeckOfCards.class/instance/cards.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
cards
|
||||
^ cards
|
Loading…
Reference in New Issue
Block a user