All language subtitles for 012 Quidditch Game – Part 5 (Tasks 7 and 8)_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 Download
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
ru Russian
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

All right, now we're really going to cover the remaining tasks for Part five inside game Java, we're

going to create a method called SIMULATE that returns a string and the string it returns is going to

be a simulation from a play that it receives.

So first from the play we're going to get the placeholder string placeholder is equal to get placeholder

from the play.

And then we need to get a random team team team from the Hashmat for which we're going to assign this

play.

We'll have to create another function that returns a team.

Public team, let's call it get random team.

And our hash map stores, every team has a key.

But from the hash map, we're going to get our collection of keys as a key set.

And now we're going to grab a random key from this key set.

The issue is that indexing sets is kind of annoying, but thankfully, we can call a method called Turei

that returns an array from this set to array returns an array of objects.

It's not specific to the type of object.

So we're just going to have to store our array of teams as an object array.

And now here we want to return a random team from the team's array.

Before we do that, I'll create another function called a random.

It returns an integer.

And accepts a range from which it will get that random number.

Notice that I'm never performing more than one task in a function, every function only does one task,

and this function is going to perform the task of returning a random number between zero and one less.

The range return method, random times range.

And we'll have to typecast that value to.

And back here, we'll say teams and grab a random index inside the length of the team's array.

And our function doesn't know what type of object this is, so we'll have to typecast it to team and

perfect.

That was a lot of steps for the one piece of logic we have to include right here.

Team team is able to get a random team and that looks really nice.

So we have our placeholder.

We have our random team, some in the crowd, and if else, if else statement that compares the placeholder

against three possible cases.

Team get positioned chaser.

And I hope you can see why I'm not playing the writing chaser, because this is an important value that

dictates how this code runs and a value that isn't supposed to change.

We need to ensure that it doesn't.

And that's why we put a constant instead, it's a lot safer anyways.

If this is a play for chasers called Coffle Score for this particular team, there are should update

by 10.

There are three chasers we have to choose from.

So we'll get a random chaser from the team team douget chasers and we'll get a random index from the

length of the chasers array.

And finally, we'll return the value that results from us replacing the placeholder from the simulated

play.

If this is a play for Seeker.

Called Catch Snitch for this particular team.

There are scoresheet update by 150 and will return the value that results from us replacing the placeholder

from this simulated play.

If this is a play for keeper.

Then there are no points associated with them, so we're just going to return the simulated plane.

Otherwise, return nothing.

You know what, I want to clean this code up a little, instead of having so many return keywords,

I'm going to set up a variable outside.

The scope of the AFL's string value is equal to an empty blank string.

I'm going to update the string inside each block.

And I'm going to have one return keyword at the end.

That looks a lot better to me.

That's all four Part five, we're going to test this function in part seven, but in the next video,

we need to apply some quality control.

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