Simon Tatham's Puzzle collection (Which has a mobile app version too!) is a massive library of puzzle games, all of which are exceptionally well coded. I'll be showcasing a few of my favourites!
First up, we have Mines, which in my opinion is the best version of minesweeper ever released. Tired of relying on RNG in certain situations? This version has you covered. It's always possible to solve Mines if you use the right logic.
There are some really cool situations that come up too- the remaining mine count is also part of the logic puzzles!

building on the above suggestions of excellent games, in particular Mines, which is a game that you're guaranteed to get a board in which it can always be solved, here's two more variations of minesweeper that will always let you win, if you're clever.
https://magnushoff.com/articles/minesweeper/
the first comes from a blog post by magnus hoff, "Solving Minesweeper" and is not presented as a game on its own, but describes the problem and provides a variation: you can at any time ask for help, and choose to reveal any square on the board as a mine or not. but if you are in a situation where you could have logically guessed a square without help, you immediately lose

the second is Kaboom from Paweł Marczewski
Kaboom instead of guaranteeing a solvable board like Mines, or giving you a magic wand as solving minesweeper did, will ensure that a guessed tile is always a mine if you could have made logical progress without random guess, and never a mine if you can't make progress. the result is a game where you can always win, if you always make the best move, and when you're pushed into the corner you're never punished for taking a stab at it. just beware you can't start by picking out the corners, once you've begin all your guesses must be contiguous.



