This video is titled Random Module. In this video, we're going to continue working with our 2D point matrix system. We're going to generate some circles like we did with the attractor point. Doing that now, I'm just using a fixed value of two as a radius and still using our saved point list. So if we run this, one thing I've added is an input for the x and the y direction. How many points do I want to create in each direction with the default being 10. So I could if I wanted to input a five, keep y at 10. So allows us to vary the size of the matrices as we run it. So what if I wanted to add an element of randomization to this where I was producing a random sized circle and that vary throughout the matrices. How would I do that? Well, there's a module that we use called random, and we import it up at the top of the code like we do with the run off script syntax. Here I'm importing it and going to refer to it from now on as rnd. We're going to be looking at two types of randomization using this random module. We go back down to our circles. I'm going to turn on these two lines I have here or uncomment them. I'm using part of the random function. So I call up the random function rnd. As soon as I hit dot, I start to get a selection of things under rnd. There's a lot of different things. We're only going to use two of these in this course, random int and random. So random int, we might use random range also. So these three are the primary ones, but the top two are really our primary ones. So random int that's the one we're going to use here. Allows us to generate a random number between and including two integers. So I'll type that in. I can hit "Enter." It shows me down at the bottom, explains the method a little bit. So it returns a random integer and range between two numbers that I set in a and b, and includes both of the endpoints. So it will also include those numbers. So if I wanted a random radius, let's say between one and five, I could generate that. Here I'm also printing out the radius. We're going to take this variable radius, going to copy it and put it in place of the two. So let's run that again. So here are those lines of codes where I'm putting in the integers for the x and the y, and I'm calling them imax and jmax. So instead of hard-coding 10 in here, I put imax and jmax in, and that allows me to change the input if I want to. Okay, that's undone. So let's run this. Enter, Enter. So now we're creating a field of random circle radiuses. If I wanted to maybe I decide that's a little big, it's a little too much overlap. So we could lessen that integer here, say to three. Run it again. Okay. So the other form of randomization we might use look at a different part of the code. If I turn on this line here, I'm using random rnd dot, just random with the closed parentheses after it. This function generates a random number between zero and one. So if we run that without doing anything, we should see a printout. Let's turn off our print radius here. So we're not printing out both. We'll run this again, Enter, Enter. We can see it's generating a float somewhere between zero and one. Never gets quite to zero and never quite gets to one. So I could use that to in a sense juggle or slightly move our grid. So to manipulate our grid a little bit within a certain range. So I'm going to undo that. Back to our code here. I already have a multiplier here for i and j. So I'm increasing the scale of x and y by five. Then I'm going to add to that this differently generated random number both in the x and the y. So it's going to shift those points around a little bit in the x and the y by a factor between zero and one. So you can see it's jostled the points a little bit. If I wanted to jostle them some more, I could create another multiplier here. Let's say times three, so it's a little bit higher. Run it again. Enter, Enter. So it's jostling our points a little bit more, creates more variation within our point grid. Don't have to be identical. If I wanted to lessen the effect in the x-direction and increase the effect in the y direction, creating a much higher multiplier in that direction. We run it again. So my points are so jostled that they completely overlapped each other. But nothing's breaking in the code and it gives a variation on that point of structure. So that's one more thing we can do with this system. We're going to look at a few more things before we finish this lesson.