You got some decent answers, but let me give you a more direct one.
NetHack is a derivative of Hack, and together they are the most successful “Roguelike.” A Roguelike is a game that is literally like Rogue. Rogue was the basis for Hack in the same way that Wasteland was the basis for Fallout. Everyone knows Fallout, not many people know Wasteland. Rogue came first and set the standard, then Hack came along and made it way better. Then NetHack and that’s what we have now. Anything like that is called a Roguelike. One of the most popular examples is the Diablo series, or the Torchlight series — neither of which is free. Their dungeons/maps are randomly generated and they have somewhat complex rules.
Another thing about Roguelikes (that Diablo and Torchlight don’t really follow) is that they have a ton of rules that aren’t presented to the player. Within the community these are considered “spoilers”. A very common example would be that if you caved “Elbereth” (I think that’s it) in the floor, monsters can’t cross that tile. But every time you walk across it yourself, the carving weakens, and it gives monsters a small chance (compounded every time you cross it) of being able to pass. The game never tells you this. I’ve just given you a spoiler on a 40+ year old game. A great example of a game (also not free) that follows this rule is Noita. A spoiler for Noita that a lot of players learn early on is that pouring water onto lava turns the top layer of lava into rock, and you can safely traverse it. But Noita, like Hack, has a ton of secrets to learn, and once you learn them, as the player, you are better equipped to handle future runs.
Then there are Rogue Lites. Roguelites aren’t really like Rogue in any real sense, but they have some element, like the spoilers thing or the random generation thing. Tunic (also not free) is a great example as you find the game manual through the course of the game, and it reveals things you either figured out on your own or you just didn’t know. It’s like playing an old NES game you borrowed, so you don’t have the manual, but you asked online and over the course of several hours, while you’re playing, people reveal to you different parts of the manual. And some parts are in another language and you can’t translate it. So that’s fun.
There are a lot of free games out there, but I’ve tried to give you a better idea of what you’re asking and what to look for.
Zoomba669@lemmy.world 52 minutes ago
I overcame OCD by playing obsessively to Shattered Pixel Dungeon.