5 ms·
Where is Minesweeper example? :-D
by hkdobrev 5y ago
Where is Minesweeper example? :-D
- p4bl0 5y agoThat would be hard to do. Checkboxes can only be in two distinct states.
- zabzonk 5y agoThree, if you count disabled.
- Wowfunhappy 5y agoAnd partial, no? So four states.
- p4bl0 5y agoRight. But that still isn't enough for minesweeper, where a cell can be: covered, marked, uncovered with no mines next to it, uncovered with one mine next to it, uncovered with two mines next to it… etc until uncovered with eight mines next to it. So except if you limit the game to having no cells with more then one neighbors with a mine, it won't work.
- Wowfunhappy 5y agoWhat I'd do: • All squares start off as unchecked boxes. • Marked squares are partially-checked boxes. • Revealed bombs (e.g. player lost, show the board) are fully checked. • Uncovered squares are deleted, and a number is placed in the space as simple text. You could absolutely argue the last point is cheating, but, meh, I feel it's within the spirit of the idea. (Undecided on whether to use disabled checkboxes to mark the perimeter of the playing field; I'd have to try it and see what felt right.)
- Zecc 5y agoWe can go higher: <input type="checkbox" /> <input type="checkbox" checked /> <input type="checkbox" indeterminate /> <input type="checkbox" disabled /> <input type="checkbox" disabled checked /> <input type="checkbox" disabled indeterminate />
- hkdobrev 5y agoSee the snake game on the website.