A Piece of the Action (Star Trek: The Original Series, Season 2, Episode 17)
In order to avoid violating the Prime Directive, Captain Kirk and Spock have to visit a planet dressed up like 1920s gangsters with Tommy guns. It turns out the entire society is based on a book about Chicago mob culture. Kirk distracts their captors with a made-up card game called "Fizzbin" while the crew escapes.
Watch Star Trek: The Original Series on CBS All Access.