Number recognition games

hi guys. i’m trying to create a number recognition games . I will describe gameplay in the below picture . the are two components on the left, if i put a component on another one, i will become a number “1”. How can i do this ? Help me,plz
alt text

What you have shown looks like a digital number display (like a digital clock). I would set up snap points for your components that make up the numbers, so that if all the snap points were filled in, that would be a representation of an 8. Then all you would have to do is check for different patterns that make up your numbers (0-9). i.e. like your image above, if the 2 right vertical slots were filled, that would be the number 1.