8.3 Creating an Athletic Competition Starting List Part 3
8 hours 33 minutes
So now that we have the function to determine the status off, none qualified.
Ah, the athlete that hasn't qualified by position.
We're going to put simple if here. So it's going to be if
G three is
smaller than three. So it's if one or two,
then we're going to have here. Q.
And if it's not,
then we're going to call function, come
status and you see it's here. And their argument for that function is going to be just the time. So we're looking at this time has qualified or not,
and to close this close this
and you see Ah, we have a typing error. So we're going to close this.
It never happens that
you have typed everything
So we're missing one t here. So link and cute time
and everything else seems to be in order. So we haven't to save this
and then to close this
and let's try this again.
Yeah, we have one. Why as well. So we cannot correct in the bunker mode,
so we have to go again.
And I'm really glad that this happened, because
now you see how it is important to take care when you're doing these things and how to be extremely, extremely focused.
So let's do it again.
Okay, so this one is not qualified. And let's move it here.
we have a small mistake.
Let's see why.
Let's see how we can debug it.
So what is obvious that I made the mistake that I have actually sorted the disarray
in ascending order because you see how many of these air qualified and they shouldn't have been. So let's go here,
let's go to module one
and let's put here three.
And now it should be Okay,
so let's close this.
It's closed this
No, let's, uh,
do this since, well, still not qualified.
And now it's okay that we have 12345678 qualifiers. Which is exactly what we were looking for. So we have now, uh, qualified
eight competitors to the finals.
And now we have to determine,
uh, which off these eighth? Ah,
go to which lane
to put their names in there.
So we're going to use names,
we're goingto make another function for it
because in theory,
we could use look up to do this,
but what we want and this is a rule in athletics. If you didn't know that the one with the best time out of those qualified
is going to be in lane four.
Then the second in lane five, then six, then seventh and eighth. Not sorry.
And so on and so on. Yeah, my mistaken in counting. 1234567 and eight.
So this is how it works. So only the 8th 1 is going to be in the lane that
is equal to his position. Or so, um
ah. So we have again to create another function
that will help us.
put the name
off the competitors
that we'll have in. And then then we as a perimeter of this function we're going to put
246 and eight.
So this is how it's going to work
and let's make this function.
So let's again to go to visual basic
plant, insert another module
and, uh, let's call it
And I was going
position of final name
and which will have one perimeter which is
and it's going to be because we're going to return the name. It's going to be string
and let's no
So this function has to do pretty much
the same thing, like the previous one on Lee with a slightly different
parts of the end.
So we're going to again
dimension when Harry.
So let's call it
and it's going to be 1 to 8 because we have only eight competitors
that we're looking at,
and it's going to be as
because we're going to have times there,
and then we're going to have to counters so dim I as integer
on Dhe. Then I won a CZ into Jer,
and we're going to have
result as well.
All right, we need to temp it to dim. It's
temper result, and it's going to be as
So we're going to do pretty much the same thing like we did in the first, so we're going to first pick. So let's copy some code.
So is good, because if you know that cold works, why shouldn't reuse it?
So let's, uh,
close this one,
and so I want is equal zero for 3 to 26.
And now we're going to look at
row. That's very calm, H.
And we're going to say OK, h and I
Q. So if it's qualified, then
we had this time and then we're going to call this one. Okay, so it's
off, And then again, we're going to look at
results. So f
and I and then def and next I
So we did this. And now we're going to sort this ray from 1 to 8 and hear from 1 to 7.
So it's just not going to be cold and your time, but our
and here a swell
then pres ult is the same.
Wondering why I didn't use in cute times. Well, there is no reason for that. I just wanted to make things a little bit more complicated.
here is a typo. So it would be an error in execution. It's okay. So now we have
very nicely sorted array off eight,
this is it.
Now we have to determine
the result we have given to this function
is, uh, in which.
So what is the name off the competitors
that has that result.
So we're going to do that in another,
uh, Loop, but it's going to happen in a next video,