Communication between arduinos over 4 interchangeable pins

Retroplayer:
Trying to visualize this. When you say cubic puzzle, I am picturing a rubik's cube, but you mention only 6 to 9 pieces, which is not enough. So, then I am thinking sliding puzzle, but that doesn't use cubes. So, I did a search and found photo puzzles, but couldn't find any example that would work with 6 or 9 pieces.

Do you have a link to a simple example?

The reason I am asking is because math is likely to solve your problem easier than trying to figure out how to communicate over different wires. When I was assuming rubik's cube for example, I was envisioning a way to simply complete a circuit based on position since a single piece is actually limited in the combinations it can be in.

There is likely a much simpler way using truth tables, if I could visualize this properly.

The puzzle should be something like this. http://www.finewoodentoys.com/files/3373883/uploaded/SG_farm_cube_puzzle_1.jpg
There's quite a lot of math worked out already in order to limit the amount of information being transfered and to make it easy to process by the arduino. But it always boils down to a cube transmitting thru each corner the id of the corner, the id of the cube itself and the info of the cubes connected to it and reading from each corner such information. Hope to make the project clearer. Thank you all!