Change the degrees, no. of flags, and flag type variables. Changing the degrees changes how many degrees of a circle the string is - setting it to 180/360 gives you half a circle and setting it to 1 gives you 1/360 which is just a straight line. And changing the no. of flags and flag type are pretty self explanatory
How this works: You need to know three things. 1. What the degrees of a circle are. 2. What the circumference and diameter of a circle are, and how they are related to pi. 3. What an isosceles triangle is. If you don't know what any of those three things are, search them up on youtube, or in your search bar, and come back here. So, the reason these things are important is because the string is between 1 and 180 degrees of a circle which is controlled by the degrees variable, with 180 being 180/360 degrees or 1/2 of a circle and the closer you get to 1 the closer you get to a straight line. You can draw this using the pen in scratch by finding the circumference of a circle (the diameter times pi) and drawing each degree of a circle by moving 1/360*circumference steps and turning 1 degree. You can repeat that 360 times to get a whole circle, but we only want to repeat it 'degrees' times, to get our string. But how do we know what the diameter should be? Well, we know we want the string to fill the entire width of the screen, so we can use that knowledge to our advantage. The degrees of a circle are basically an isosceles triangle except without the bottom. We can add that side in and say it has a width of 480 (the width of the screen). Then we can use trigonometry to find the other two sides of the isosceles. Now, remember that this is actually the degrees of a circle and not an isosceles triangle? Well that means the two arms of the triangle are actually the radius of the circle and we can use that to find the circumference, which is equal to 2*pi*radius. And that's all the math. Let me know if you understood all that in the comments, but feel free to just copy the code if you want to use it in your own projects.