All language subtitles for 006 For Loops_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

In the last section, we put together our deck constructor function, which is going to be a perfect

location to create our list of 52 cards and add them all to this cards list right here before we start

just writing out some code to make that happen.

Let's take a quick look at a diagram that's going to lay out the strategy that we're going to use to

create all 52 cards in one fell swoop.

All right, so here's the idea, we're going to begin by creating two separate lists, each list is

going to contain a bunch of strings.

Now, we haven't dealt too much with lists just yet, but lists are essentially identical to arrays

in just about every other language.

So we define a list by placing some square brackets like so, and then we separate all the elements

inside of it with commas.

We're going to have one list of all the different ranks, like ACE two, three, four, five, six,

seven, all the way up to King.

And then our list of suits of hearts, diamonds, spades and clubs.

We're then going to write out a nested for loop, so we're going to save for every suit inside of this

list of suits and for every rank in this list of ranks, we're going to create a brand new card and

add it to our cards list.

And remember, the cards list is a field on the deck class right here.

OK, so let's find our constructor function.

Here it is right here, and we're going to start implementing this logic will first begin by creating

the ranks list and then these suits list and we'll put together these four loops.

So let's get to it.

All right, so I'm going to write out first my list of how let's do ranks, so let's save our ranks.

I'll place my square brackets and then I'll do ASW to.

Three, four.

Five, and I think that's probably enough, we could definitely go all the way up to King if we wanted

to, but I think five is enough and I'll do the same thing for my list of suits.

So I'll do what is it, diamonds?

Hearts.

Clubs, spades.

So then we're going to put together a double nested for loop for loops inside of Dart, again, very

similar to just about every other language out there.

So we write our four keyword and then we can vary it very easily.

Iterate over all the elements inside of one of these lists.

By placing a set of parentheses, we'll write out a variable to capture each individual element.

So I'll say for var suits in suits.

So this for Loop right here is going to iterate over every suit within our list of suits and then it

will execute the body of the for loop right here.

So then inside this for Loop, we're going to set up another one, we'll say, for every.

Rank in our list of ranks, and then right here is where we can add some code to actually go ahead and

create our new card and add it to our list of cards.

So let's take a quick pause right here.

When we come back in the next video, we're going to start adding the logic to create each individual

card.

So quick break and I'll see you in just a minute.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.