You're likely thinking of "Slide the Tiles"—a common party sliding puzzle game. Here's how it works:
Let me know if you had a specific game in mind!