Just click the green flag! When it is completely filled, it will stop itself and show a little red "X" towards the center. You may copy and paste this and use it in any other maze games you may be in the process of making. Also if it looks weird just try the green flag again and again until it is a better defined shape.
Thank you, @griffpatch for the costume ideas! Rewrote the code myself, though. sadly no different size mazes cuz l suck at this and it keeps bugging