Earlier quoted context omitted.
Your reply reminded me of the free game Oiligarchy by Molleindustria (which made quite a few indie hits in my opinion). In that game, if you played "well" you ended up destroying the world. The only winning move was, indeed, not to play.
I think OP is referring to the 80's movie WarGames - https://en.wikipedia.org/wiki/WarGames At the end a strategic defense computer is asked to play Tic Tac Toe against itself and suddenly "learns" about no-win scenarios. Then it does the same with nuclear launch scenarios, and finds that they're all no-win. It decides that nuclear war "is a strange game", and "the only winning move is not to play".
I very intentionally meant that it also applies to Oiligarchy [1], an actual game (not a movie) where the winning move was not to play :)
---