Trying to remember a short story that I think was written by Eric Frank Russell. The protagonist lands on an alien world and they decide to execute him. They view themselves as civilized, and allow the to-be executed to play one game of their choice before death. Win or lose, they are still put to death, but particularly skillful players can use it as a means of extending their lives. The government also broadcasts it, because people love to watch folks quite literally playing for their lives.
But there were rules (I remember these, there might have been one or two more):
It had to be a real game, played somewhere by people, not just something you made up
There had to be a way to win and lose, a definite ending.
The Terran knew it was a matter of time until he was found and rescued. So he introduces the aliens to a version of the game Tiddlywinks. It's something like- you have three rods, with a series of hoops of different sizes on two of them. You have to transfer all of the hoops to other rods in such a way that they go in order from largest to smallest. The aliens have never heard of it but went along with it. It seemed a mindless children's game, something that could be wrapped up quickly. If anything, they were disappointed, because they were expecting something new and unusual from an Alien.
After a few days, they realize that something is wrong, do the calculations, and realize that the game will take literally billions of years to complete. They confront the protagonist about this and he explains that there are indeed monks back home who play the game, believing that once the game has completed, the universe will end.
Infuriated, the aliens change the rules so that the game has to be one recognized on their own planet, but the old rules still apply to the Terran. So every day for a couple of years he has to continue to play Tiddlywinks. Eventually he is rescued, having kept his sanity after opponent after opponent has lost theirs.
The story ends with his rescuer inviting him to relax, saying they have tiddlywinks aboard if he wants.