What does the "Generate Puzzle" button does?

So if you go to file and select "Generate Puzzle" it blocks all tabs and deletes all blocks, but why?

The 'generate puzzle' essentially gives you a project where only the blocks necessary to produce what's in the scripting area are visible.

The idea is mostly for teachers, who might want to give students a limited environment (which we often call a "microworld") to focus practicing with just a few blocks. Ideally, of course, you delete the code in the scripting area before sharing it with students.

Thanks! I can't believe I'm talking to a Snap! dev :o