Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In this section, we're going to take care of our last method down here, the remove card method.
So the idea behind this method is that we're going to try to remove one particular card from our deck.
I can't really imagine where we would use this method in a real card game, but I'm sure there's some
card game out there where you have to, like, find the ace of spades or something and take it out of
the deck.
Now, for this method, we're going to do things just a little bit differently.
So here's what's going to happen.
We're going to have you take a shot at putting the remove card method together.
OK, so you're going to take a shot at it on your own using nothing but the code that we've already
got over here and dart pad and the list class reference that we've been looking at quite a bit so far.
So I'm going to give you a couple of little tips here just to get you started and then I'm going to
cut you loose.
So the first thing I want to point out here is inside of the last class documentation, if you scroll
down inside the documentation.
So I'm going to go down, down, down again until I find the method section.
I think I just passed it.
So here's the method section.
And I want to point out one particular method to you.
The remove where method right here.
I want you to take a look at this method right here and I don't know, just kind of get a sense of how
it works.
The removed method expects you to pass in a function to it.
That function will then be executed with every element within a list.
And then if that function returns true, the element will be removed.
But if it returns false, the element will stay around.
And so we've already worked on a very similar function, very similar in nature to this one right here.
You'll recall we put together our.
Cards with suit to function right here.
So this was very similar in nature, but this was where and maybe, I don't know, maybe you might want
to take a look at remove wear right here.
OK, so then the other thing I want to show you very quickly is back inside of Darte Pad, I really
expect that you're probably going to add a new method to our class.
So maybe a method right here.
Maybe you're going to call that method something like remove card, I don't know, it's totally up to
you and chances are that when we call remove card, we're going to have to pass in both the suit and
rank of the card that we want to remove.
So whereas back on the.
Tarred with suit method that we passed in right here, or the method that we created right here, we
were only passing in the suits.
I kind of expect that for a remove card method, we'll have to pass in both a suit and a rank to specify
what card we're trying to remove.
OK, so I want you to give it a shot, do the best job you can.
If you get stuck, don't sweat it.
We're going to go over a solution together right in the next section.
So 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.