02-12 Leaving Happy Valley Solution

• 0:00 - 0:02
[Norvig] I know there can be matters of opinion here,
• 0:02 - 0:04
but from my point of view they're all reasonable.
• 0:04 - 0:07
So they would all work. They'd all be fine.
• 0:07 - 0:11
But for the moment, this one looks just a little bit simpler, so I'm going to go with that
• 0:11 - 0:14
until I have some proof that the simple won't work
• 0:14 - 0:17
and that we'll have to go to something more complicated.
• 0:17 - 0:21
In this approach we named the properties.
• 0:21 - 0:23
We talked about the possibility of whether you have to do that or not.
• 0:23 - 0:27
Here we aren't naming them, and so it will be up to me as the programmer
• 0:27 - 0:30
to manage the groups of properties.
• 0:30 - 0:32
Here's 1 way I could do it.
• 0:32 - 0:37
I could simultaneously assign the 5 properties that are in the same group of color
• 0:37 - 0:39
to the 5 houses.
• 0:39 - 0:41
Of course this would only be 1 of the possible assignments.
• 0:41 - 0:45
After I tried this one, I'd have to try another assignment--
• 0:45 - 0:51
maybe [1, 3, 2, 4, 5]--
• 0:51 - 0:54
and I'd have to go through all the possibilities.
• 0:54 - 0:56
Can you think of a good way to do that?
• 0:56 - 1:00
What statement or other implementation can you come up with
• 1:00 - 1:05
to have the 5 properties go through all the combinations of possible houses?
• 1:05 -
And if you want, pause the video now and try to think of that on your own.
Cím:
02-12 Leaving Happy Valley Solution
Leírás:

more » « less
Team:
Udacity
Projekt:
CS212 - Design of Computer Programs
Duration:
01:10
 Amara Bot hozzáadott egy fordítást

• Amara Bot