Here is a program that I am making that generates a shape based on which number you type into the keyboard. The number determines how many 'legs' the shape has, and the shape looks like a starfish. I am doing it by rotating the canvas then drawing each line. The trouble is, it is only drawing things some of the time. The attached image shows what should be a starfish shape (5 has been pressed), but instead only draws 3 of the legs. I've been printing the angle, and it definitely cycles through all of them but just doesn't draw the line sometimes.