Four-dimensional chess was a game devised by Harb Tanzer aboard the USS Enterprise with the help of the computer system he dubbed Moira.
The game used a sophisticated transporter to move around the physical chess pieces, which were "embedded" into the system. The board could be rotated 360 degrees and tilted, turned, or magnified for study before making moves. Players could also "rest" pieces for a time, removing them from the game before engaging in a strategy, such as attacking from behind, once the pieces returned.
The transporter system in the game was later used to help free the Enterprise from Tafv's forces. (TOS novel: My Enemy, My Ally)