First piece of code, a night sky creator.
Basically, the code places multiple stars of different size on a surface, keeping track of the biggest ones. Later those are revisited creating links between the closer ones, but only including them in one constellation, so when the program connects enough stars it will start a new constellation, until there’re no more stars to visit.
May not be efficient, but I think the results are quite good. I should change the drawing part so the smallest stars would be drawn as one pixel and not two, I may change it later.
By the way, I’ve used the pygame package, you may need to install it if you want to use the code.