# Help with this solitaire array please?

Attention Topic was automatically imported from the old Question2Answer platform.

Hi all,

I am currently creating an array like so:

``````func createDeck():
var cardFaces = []
var suits = ["Hearts", "Diamonds", "Clubs", "Spades"]
var royals = ["J", "Q", "K", "A"]

#add numbers 2 to 10 and convert them to string
for i in range(2,11):
cardFaces.append(str(i))

for j in range(4):
cardFaces.append(royals[j])

#let's make the faces and finalise the deck
for k in range(4):
for l in range(13):
var card = (suits[k]+cardFaces[l])
globals.deck.append(card)
``````

It works well, it creates 52 items in an array, each named similar to :

``````Hearts2
Hearts3
Hearts4
Hearts5
Hearts6
Hearts7
Hearts8
Hearts9
Hearts10
HeartsJ
HeartsQ
HeartsK
HeartsA
Diamonds2
Diamonds3
Diamonds4
Diamonds5
Diamonds6
Diamonds7
Diamonds8
Diamonds9
Diamonds10
DiamondsJ
DiamondsQ
DiamondsK
DiamondsA
Clubs2
Clubs3
Clubs4
Clubs5
Clubs6
Clubs7
Clubs8
Clubs9
Clubs10
ClubsJ
ClubsQ
ClubsK
ClubsA
``````

What I want though, is to create something like:

``````Hearts, 2, Red
Hearts, 3, Red
etc
``````

I guess it’s 52 lists in a list? I’m not too good at this kind of thing but getting there. How can I go about making a list like that with the above info?

Thanks so much.

Got it.

``````func createDeck():
var cardFaces = []
var suits = ["Hearts", "Diamonds", "Clubs", "Spades"]
var royals = ["J", "Q", "K", "A"]

#add numbers 2 to 10 and convert them to string
for i in range(2,11):
cardFaces.append(str(i))