News for hackers. Stuff that matters.
Re:Show HN: MineSweeper implemented in 100% CSS and HTML – n... by cnees on Thursday July 23, 2020 @03:48AM (#23925117)
To emulate Minesweeper's not-a-bomb-on-the-first-click experience, I start the board off with a generous region revealed, and then to emulate flood-filling, I make blank cells sit in an invisible (overflow hidden) scroll box that scrolls to a revealed version of the region when you click the blank cells, which have relative links. That only works for rectangular regions, but I remember having a way to make it work with irregularly shaped regions and being too lazy to implement it because it was going to be even trickier and uglier than what I was already doing. I'll leave that as an exercise for the reader. :P

There are no comments on this comment yet.