All language subtitles for 014 Pokerito Solution - (Task 2 – 5)_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

Onwards to part two, and the next task is to start the game by explaining the rules, all you have

to do is print the rules.

So I'm going to make eight print statements.

I'm going to apply the new lines where it's necessary, so here, in here.

And where you see a vertical line, we're going to you scan the next line to get the user to press enter

when they're ready.

And for the sake of running the task, I'm going to remove this function call and then I'll compile

and run the code.

Seems like we're off to a good start, the game starts by explaining the rules.

All right, so now once the user is ready, I have to present them and the computer with a card.

This is as simple as calling the random card function twice, so I'll set a variable string, your card

is equal to a random card and string computer card is equal to another random card.

What I'll do now is I'll print each result according to the instructions I left you in Task three,

so I'll print here's your card.

Then I'll print the user's card.

Then I'll print the new line, as mentioned in the instructions.

And I'll continue printing everything according to the instructions.

OK, you're running my code once more.

Presents me with a card and it presents the computer with a card as well.

I'm going to rerun my code multiple times to make sure the computer and I keep getting random cards.

And everything seems to be working perfectly.

All right, it's time for task, for the next task is to get the dealer to draw five cards.

All this means is that we need to create a for loop that runs exactly five times.

And every time it runs, it's going to call the random card function.

So first, I'm going to print the message now the dealer will draw five cards, press enter to continue.

And then I'll create a for a loop that started equals zero.

Keeps running till I'm less than five I a plus plus in this loop is going to run five times and we want

each card in the river to show every time the user presses enter.

So it only makes sense that we write scan the next line at the beginning of every run.

And after the user presses enter at the beginning of every run, I'm going to draw a random card and

print it.

So that gives me and the computer recovered card, and now we're inside the loop, and every time I

press enter, it draws a new card and it's going to do that five times.

Now, before drawing each card, I want to print the order that it appears in.

So what I can do is print card.

And connect the current value of the counter I during each run.

And now, every time I press enter, it draws a new card and it prints the order that the card appears

in, but it starts at zero and it ends at four, which is kind of weird.

But that's to be expected because the loop starts with equaling zero and it's going to keep running

until it is less than five four, so it's going to run five times.

And during each run, it is going to equal zero one, two or three.

And then the fifth run, it's going to equal four.

But what I can do is have the counters started I equals one and make sure it keeps running as long as

I is less than or equal to five.

So this time, given our starting point and the stop condition, the loop is still going to run five

times, but the counter starts at 1:00 and it keeps coming up until it equals five, beyond which the

condition turns false and the loop breaks.

So here we enter the for loop, the counter starts at one and the loop keeps running until I equals

five and that is perfect.

That is all for task for.

I'm just going to zoom in a little bit.

But as you can see, the only hard part was really creating the random card function, the whole code.

Up to this point, I just been calling the function in different places.

OK, so we're done task for moving on to Task five, we need to determine the winner.

So if you remember in TASC three, the user was given a card and so was the computer.

I need to determine how many times the user's card matches with the river and how many times the computer's

card matches with the river.

And so you'll notice that I left you to integer variables.

They should already be in your workbook.

So inside the loop, as the dealer draws the river, I'm going to compare the user's card against the

card that's currently being drawn.

And if the user's card equals draw the card that's being drawn.

It means the user has a match, and in which case I'll increase the number of matches by one.

And if it matches the computers card.

I'll increase the number of computer matches.

And so now I'm going to print your number of matches is and I'll conduct your matches.

Then I'm going to print the computer number of matches.

Connecting the number of computer matches.

OK, so I got a king and the computer got a 10.

Hopefully I can get more matches than the computer and it seems that none of us match with the ace or

the three or the seven or the four.

And we both have zero matches.

Try this again.

Now I have a six and the computer has an eight.

But when it seems the computer has a match with eight oh and I match with a six boy, this is exciting,

seven nine and it's a tie, OK, whatever.

But in the end, it reflects an accurate score of one and one.

I have one match and the computer has one match.

And now for the last step, after the dealer dragged the river, we need to determine the winner.

So if your number of matches, the users matches, is bigger than computer matches.

We're going to print Ewin.

But if the computer ends up having more matches.

Print the computer wens.

And if they're equal.

Everyone wins.

So it seems I have three.

The computer has a J.

It's a tie and everyone wins.

Let's try and test a scenario where one of us wins.

And it's a tie again.

Oh, I think the computer is going to win this one, and it does.

Let's try and test the scenario where I would win.

So I have a 10.

The computer has a niece and it matches with two other aces in the river, so it wins once again.

And I'm just really unlucky at these Jova games.

But anyways, I'm confident that everything works the way it should.

That is all.

I hope you had fun building poker, Rido, and I hope the solution clarifies any doubts you were having,

because your big challenge is going to require you to build a similar project, blackjack.

So I hope you're ready.

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