Grid tiles Coding Problem
Super Hard Q: Given a grid with inputted dimensions and an inputted starting point, how can you make an algorithm that will place the (positionally untouched) tiles link together so that they extend from the left side to the other? The only tile parts that can touch the ends are the circles on the tiles. All of the tiles must be connected, and the tiles must be in alphabetic order (if a piece doesn't fit, you skip and go to the next alphabetical piece, or the beginning if tile C doesn't fit). The grid is numbered, and the user inputs the location of the number of blocked cells, and then the cell number of each blocked cell. A blocked cell cannot be occupied by a tile. Finally, the pieces cannot overlap. I really need help with this problem, and if someone could attempt it, I would be extremely grateful.