Moved problemText definition to top of generate()

This causes the "problem not found in problems.txt" error to display
before the file generation prompt.