Programming-related games are a very popular topic on Reddit and elsewhere. These are the games I find most interesting and/or have seen recommended most often. Some of them actually attempt to teach you a real programming language, and some are more about logical/procedural thinking.
[This list doesn't contain programming challenge sites like HackerRank or LeetCode. Those are arguably very similar, but there are a million of them and for my purposes they aren't "gamey" enough to include.]
- Reddit - 31 Coders Games and Puzzle Sites
- Reddit - A friend introduced me to this site that lets you practice security concepts in a game
- Reddit - Games to help both young and old get into logic, engineering, and programming
- Reddit - Programming Puzzlers Wiki
- Reddit - What are some problem solving games that scratch the programming itch?
- Medium - 12 Free Games to Learn Programming
- Medium - Collection of Coders Games to Improve Your Skills
- Geeks For Geeks - 10 Best Coding Games to Advance Your Programming Skills