This video is titled, not equal to. It's the last video of this lesson, and we're still working with our 2D point matrix. I'm going to pose a simple question. We're labeling our index numbers. Let's run this enter, enter. Creating our matrices at points. The question is, what if we wanted to draw a line from one point let's say 0.25 here, to all the other points within the matrices? How would we go about doing that? Let's go back to our code. As I loop through my points here, I can create a line within that loop using the function AddLine. We can add a line. Picking out index, so the point that's held in point list index 25. I want to draw a line from that to every other point within the list. Let's run that and see what happens. Enter, enter. It works fine until it gets to that 0.25, and then it throws an error. The error is just that it's unable to add a line to the document. That's from trace back line 36. The reason it's unable to add a line to the document is, it's trying to add a line between two coincident point values. At that point when it gets to 25, our point list I is 25, and point list 25 is the other value that I'm trying to draw and I can't draw between a coincident point. I can't make a line between points that have no distance between them. In order to get that to work, I have to add a conditional statement that uses the operator, not equal to. I need to make sure that this line is indented in that conditional. What this is saying is that, as I loop through the points, I want to add a line between all those points which are coincident. When it gets to 25, it just skips that. Because it's saying, only create a line if point list I is not equal to point list 25. What it's really comparing there are the values that are held within those index slots. We run this again, enter, enter. That works fine. Now, what if instead of 25, we wanted to pick a random selection from our matrices. Pick a point randomly that we wanted to draw lines from. How would we do that? Back in the code, we could create. We don't want to create it within the loop, we want to create a random integer generator outside of the loop. This could be here, it could be up at the top of the code. It just doesn't want to be in any of these loops, so it's got to be an indented. Here is just fine. Since my point matrix C starts at p, and it goes up to 99, I have to create a random integer selection in between those two numbers. Using our random int function, I put zero and 99, and that creates. I'm going to hold that value in a variable called random index, and then replace 25 here with that random index, whatever that generates. Let's run it again. Now every time I run this, it should create different outcome, although sometimes it might pick the same number. Now one problem with this system is, because in my code I've given the option of my input. It might not always be 10. If I put in a small number, let's say two-by-two grid, then I might get an index out of range error. This is being thrown from line 35. What the problem is, that I've generated a random index number that doesn't exist. Because I have only a list of points that's only 0, 1, 2, 3. It's only four points in that list, and it's produced an integer 13, and it just doesn't exist in the list. I need to come up with a little equation that determines that random integer based on my input values. My default is 10 and 10, which gives me a grid of a 100 points. But my counting starts at 0, so I ended at 99. That's those two numbers, the two input numbers, for imax and jmax, minus 1. 10 times 10, it's 100, 100 minus 1 is 99. It's minus 1, because my counting starts at 0. That gives me the logic of my equation. Instead of this line of code, I'll replace it with this line of code. Now I'm always going to start at zero, so I can put that in. But my imax and jmax values are here, and that's going to determine my ending integer, minus 1. Now we could run that again, so I could do five and five, and that should never break. Now, one last twist. What if I wanted to, going to comment this section out? What if I wanted to draw a line from every point in the matrix to every other point? How would I do that? I need to use a nested loop. I create a loop through a point list twice, and within the inner loop, I create a conditional statement that says, if point list I is not equal to point list J, then add a line. This works. I select the first point list 0. That comes in, and then that's going to stay 0 the first time through, and then I'm going to loop through the J loop, I'm going to loop through all the points, and I'm going to add all the lines. It's just not going to do it for whatever is the current point in the I loop. It's able to do that, because I use this not equal to. Let's run that. That's one we can dwell on for a while. That's a lot of calculations done in a pretty short amount of time.