Prize Pipe Paths
From the Super Mario Wiki
The minigame is based on amidakuji, a type of Japanese puzzle. In this minigame, there are five vertical Warp Pipes, with each one leading to ? Blocks containing different prizes: two holding one coin, one with three coins, one with three Battle Cards, and one with five Battle Cards. Between each pipe are also several horizontal, interconnecting pipes. After a preview of the pipes' paths, Mario must enter one of the five pipes. While inside, Mario will automatically take any interconnecting pipe he comes across, and eventually reach the exit and the prize.
"Pick a pipe–get a prize! Mario will always turn when he reaches a sideways pipe!"