diff --git a/RoloLudo.package/DeckOfCards.class/class/faceCards.st b/RoloLudo.package/DeckOfCards.class/class/faceCards.st new file mode 100644 index 0000000..987741e --- /dev/null +++ b/RoloLudo.package/DeckOfCards.class/class/faceCards.st @@ -0,0 +1,3 @@ +accessing +faceCards + ^ #( $J $Q $K) \ No newline at end of file diff --git a/RoloLudo.package/DeckOfCards.class/class/initialize.st b/RoloLudo.package/DeckOfCards.class/class/initialize.st index 3ef929f..70e53d4 100644 --- a/RoloLudo.package/DeckOfCards.class/class/initialize.st +++ b/RoloLudo.package/DeckOfCards.class/class/initialize.st @@ -1,4 +1,9 @@ accessing initialize | response | - response := self new. \ No newline at end of file + response := self new. + self suits do: [:suit | + self numeralCards do: [:number| + response cards add: number asString, suit. + ] + ]. \ No newline at end of file diff --git a/RoloLudo.package/DeckOfCards.class/class/numeralCards.st b/RoloLudo.package/DeckOfCards.class/class/numeralCards.st new file mode 100644 index 0000000..845202b --- /dev/null +++ b/RoloLudo.package/DeckOfCards.class/class/numeralCards.st @@ -0,0 +1,3 @@ +accessing +numeralCards + ^ 1 to: 10 \ No newline at end of file diff --git a/RoloLudo.package/DeckOfCards.class/class/suits.st b/RoloLudo.package/DeckOfCards.class/class/suits.st index fba9eda..b4129ec 100644 --- a/RoloLudo.package/DeckOfCards.class/class/suits.st +++ b/RoloLudo.package/DeckOfCards.class/class/suits.st @@ -1,3 +1,6 @@ accessing suits - ^ #('clubs ♣' 'diamons ♦' 'hearts ♥' 'spades ♠') \ No newline at end of file + ^ { '♣' -> 'clubs' . + '♦' -> 'diamons' . + '♥' ->'hearts' . + '♠' ->'spades'} asDictionary \ No newline at end of file diff --git a/RoloLudo.package/DeckOfCards.class/instance/cards.st b/RoloLudo.package/DeckOfCards.class/instance/cards.st new file mode 100644 index 0000000..8341fdf --- /dev/null +++ b/RoloLudo.package/DeckOfCards.class/instance/cards.st @@ -0,0 +1,3 @@ +accessing +cards + ^ cards \ No newline at end of file