I have a list of elements numbered 0-40, let's say it's:
0-9 = leter 0-9
10-35 = letter A-Z
36 = green emerald
37 = yellow emerald
38 = red emerald
39 = purple emerald
40 = bd diamond
In the first area of the level, player can enter 10-digit number:

































When player presses the red button, the elements which he requested appear in the second area, so for example, if he entered 17-14-13-36-40, the level creates this:





The key is that I must have some list of the elements and I need to locate the element with the number that I need, but I need to do it accurately and as quick as possible. (Maybe something similar was used in Zomis' Advanced Minesweeper to apply level width and height?)