Problem 1 is a trick question because you said "displayed hamsters"
Hehe, this sort of answer classifies you as a good mathematician or computer scientist: Edge cases matter. Also good backroute.
Design of a search feature: Hide your complexitytl;dr: Use fibers for expensive work.
Lix 0.9 will have a level search. Type a query into a search box, and the game presents you a list of levels that match your query. I'm proud of this feature because I thought of it first: No other Lemmings engine has it, nobody has requested it before, but I'm already using it in my regular level-maintaining workflow. Good stuff. Good broccoli.
I want to be Google! What are the hallmarks of Google search?
- One good search box, no distracting options.
- Searches in everything you might want to. In our case, filenames and level titles.
- While you're typing, you're already seeing first hits on the screen.
- As you type more characters, earlier hits vanish as they become irrelevant.
- Hits appear and vanish in realtime. Very handy: You can stop typing when you've narrowed down to 1 hit.
- All this good stuff happens magically in the background, it doesn't freeze the app.
Now, I said that the search matches both filenames and level titles. The operating system can quickly produce a list of files in
levels/, but to filter for level titles, I have to open each file and read the first couple lines. Opening a file is crucially slow: With 1,100 files in
levels/, if I open them all in one loop, Lix freezes for a second -- despite my decent CPU, RAM, and SSD.
I could read and index all levels when the program loads, but that goes against the general laziness of the design. I load resources only when I need them; in exceptional cases, I load them when I'll probably need them. Also, if I loaded everything at start of program, Lix would ignore when you move files externally while Lix is still open. And I'd have to hard-wire indexing of new files that you generate with the editor... Blergh, this is asking for bugs from outdated caches. No no no.

Instead, I index afresh every time I open the search dialog, but hide the work. Getting the tree of filenames from the operating system is fast, I do that immediately, eagerly. Then, Lix begins indexing the levels by opening the level files one after another, caching the level title. After a bunch of files, there comes the time to paint to the screen, read hardware input again, etc.; then we interrupt the caching and work with the half-done index. When the main loop hits the search dialog for the next time, again we work on opening some remaining files, improving the index. Eventually, 1 to 2 seconds into the dialog, the index is complete.
Even if this takes a couple seconds, we can already start typing into the search box, with good performance. We don't get 100 % perfect preview hits, but they will become better in the blink of an eye. On my fast machine, I don't even notice anything off, it looks instant. I'm sure it feels reasonably good on slower machines, too.
Most importantly, The game doesn't freeze during the indexing by definition.

We index while the game would wait on the next frame anyway, then we paint.
The general concept behind this is a
fiber. It's not a full thread or process, but it's an expensive function in the main thread that you can pause and resume. You don't get the result ASAP, but you get it reasonably early, and you don't have to freeze your program meanwhile.
I have only this one fiber, and I even rolled my own code here. I simply let the fiber run until I would draw. This approach obviously doesn't generalize to having more fibers. If you want many fibers producing all sorts of good work for you, look into your language's standard library.

-- Simon