Scramble objects in a grid

I have a game with a 4x4 grid of tiles. Each tile is unique and will be hit in a specific order, 1-16. When I hit space bar, I want the tiles to be in a different random location in the grid, which is where I have my problem. I used logic bricks to set up the 1-16 sequence, but I can’t figure out a way to use logic bricks to randomly seed a location on the grid without ever duplicating tiles to the same location.

Does anyone know how it could be done using python? I have attached an example file with a grid of tiles. I am looking for a script I can attach to a keyboard sensor (space bar) which will randomly scramble the 4x4 grid. If it helps, I have the tiles labeled “cube01, cube02, …cube16” etc. Any help is greatly appreciated.

scamble_test_v03.blend (1.93 MB)