Hi, welcome to this last and final video of this week. We're going to be wrapping up the project of the way function collapse algorithm. Let's discuss a little bit what this algorithm is, what it could be used for. The way function collapse algorithm can be found in numerous design applications. We're working with an algorithm that is a procedural design or a generative design algorithm. You can see it in the design of levels in games. You can see an architectural layout. It's certainly useful for graphic design and art, anything that has to do with tile-based artwork. It's certainly very powerful and it has many variations. I invite you to start looking into the different variations that you could achieve with it. You could actually work with hexagonal patterns. Certainly if you're working in a 3D environment, there's great games and projects in architecture that have been using this algorithm in 3D to really start operating more in a voxel space and how do you achieve the compatibility between tiles, but it uses similar principles. The principles of compatibility and how that is demonstrated either graphically in a pixel tile or in the geometry of 3D tile. I would like to do some final clean up modifications, try to make the algorithm a little bit more expressive, see it run in its full form so that we conclude this course and this week with this beautiful algorithm executing in full form or in full capacity. Let's just jump back into the code and do a little bit of clean up. Just to conclude, we're working and finishing on the same project. The first thing I would like to do, it's increasing the resolution. Many times I invite students to work with a very small resolution. We can see things very clearly. But once you have things working, it's interesting to see how we could actually increase the resolution of an algorithm and see the computational speed and the execution of everything happening at a larger scale. I'm going to basically bypass our system. That requires us to press a button for updating just by running the my_environment.run function without this if statement so we can actually see it execute in real time. The fact that we have a larger environment means that the cell size is going to be smaller. The thing that we actually never did, actually if you go here to the display entropy of the tile, you probably saw in our slides that we were changing the color of the text and changing the size of the text dynamically based on some criteria. Let's do that so that we can give it a bit more expression to the algorithm. I'm going to call this text not green. It's like a path name, but you'll see what I mean by that. I want to map. I love the map function. It's a very quick way of converting a variable, something like entropy. We know that the entropy goes between one and 16 and we're going to convert that to a value between zero and 255. I say not green because we're going to use it for the red and the blue channel of our fill. The fill here, we're going to say text no green. RG, this is going to be the green value. That's going to remain at 255, so it's intensely green. When it's a small number, then we can actually just affect the red and the blue channel. That would change the color of the text, but we want to also do some dynamic size of the text. Let's just map also the entropy. That goes also from 1-16. Here we're going to invert the number. We're going to say if the number is closer to one, it's going to be bigger, so it's going to have more expression. If the number is large, it's going to be smaller. Here, you have to be careful. As you're working with a tile set that is bigger or smaller, this number should never go below zero. You might want to do a revision saying if it's below zero, keep it at maybe one. Or if it's close to one, give it a minimum number. But in this case, we're going to remap the entropy of one to a size of 20, entropy of 16 to a size of eight. That's the domains we're going to be working. This text size, we can use that to basically alter and we're going to comment out this line here. That says text size 16, so now the text size is going to be defined by this new variable. That was an arbitrary number that we were using. Now, this is actually using a mapping function. I think that's it. Let's see what we have and we could evaluate if there's any errors or things that we would like to change. There we have it. We have much smaller cells. They're actually executing automatically without the pressing of a button. You can see how the cells are actually nice, bright green color when they are with a lower number and this smaller white number of 16 when they're going to have multiple options. We can see the algorithm executing and resolving the entire fill. This is a conclusion of this week. This is the full form of the algorithm the way function collapse algorithm. We're going to be concluding here. In the next final video for the whole course, we're going to be revisiting and understanding what we have covered throughout this specialization and discussing where you can go next. I'll see you then.