Creating a sliding Number puzzle


So i was wanting to know is making this sort of thing possible? for example is there a way to make the game process that the numbers need to shift into specific spots but only if that spot is empty. basically, just need to be guided through this. kindve like a lot of if, then statements. Please help.

Unfortunately I don’t think its possible. I mean, you could do it but it would take a lot of devices and text in order to do so, and the memory that a map has would already be full.