georgio

100% WORKING

video game producer, terminal lurker. maybe cohost will unleash the peast (posting beast)


noa
@noa
Minesweeper Β· 33 mines
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
πŸ’₯
You lose
You lost the game.

Retry
2
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
2
1
1
2
1
2
2
1
2
2
2
2
3
3
2
1
2
2
4
2
1
3
2
1
1
2
1
2
2
1
1
2
1
1
1
1
1
2
1
3
2
3
2
3
4
4
2
2
2
2
1
2
1
1
1
2
1
1
3
1
2
1
1
1
2
1
1
1
2
1
1
1
1
1
4
1
2
2
2
3
2
2
2
1
1
2
1
1
1
2
1
1
1
2
2
3
2
2
About
inspired by @minesweeper because her account is named minesweeper and like i realised you can make minesweeper on copost host chost

in my dev version i can use transform-origin:center center !important and it looks soo much better i'm so sad :((

tip: start in the bottom right corner. i unfortunately couldn't make it do the minesweeper thing where your first square clicked is always clear.

You must log in to comment.

in reply to @noa's post:

hohh this is really good,, the big challenge for me comes from the fact that i can't place flags on this (i think) so i can't rely on my visual reflex to SPEED through this one, so this was a nice slowed down lil puzzle!!

my first reflex was to clear the first space in the top-left corner cause the post text was collapsed by default ;w;

i considered adding a flag checkbox thing in the corner of the mines but felt like it would add unwanted visual noise. unfortunately, i can't detect right click and perform a different action for that

unfortunately, while that is possible, it's not possible to make the flaβ€” wait a second

yeah

ok yeah that's not possible. i can make a button that lets you place flags, but when you press the button again because you're done, all the flags will disappear until you open the flag placement tool again.

yeah, it should be interactive and look like this:

screenshot

i'm not sure what could be causing that particular issue - what extension would automatically open details tags?

it's working for me on:

  • firefox 1.06 with ublock origin
  • firefox nightly 1.08, no extensions
  • chromium 1.06 with ublock origin
  • android firefox with ublock origin
  • ios 15 safari with some adblocker

that's a good question. if it's an extension's fault it's probably uMatrix's, but we tried in an incognito window, where that shouldn't be relevant. perhaps it's Firefox Enhanced Tracker Protection somehow?

ah well! it looks like a super cool toy, and just to be clear, our browser is heavily modified and most of the web is broken in it until we specifically tweak things for each site. (that's how we like it.) so the fact that your thing doesn't run on our system is not in any sense the fault of your thing.

If it wasn't working when you replied to my comment then I have no clue because I made a change 32 minutes ago to fix it for safari that might have solved it. Otherwise, I have no clue. Magic faries uncursing the computer cpu silicon rock electricity

hmm. it works on my computer (firefox 1.06, out of date) and my phone (firefox) and the latest firefox nightly (1.08 r20221103214316). i made sure to test it on chromium before posting, so maybe that might work? i can't imagine what would be causing it to break like that unless somehow all the details elements are getting opened by an extension or something

It's suddenly working now? I tried turning off ublock and it worked, but then I turned it back on and it still worked, so I'm lost unless you changed something.

Either way, now that I can play it I can say it's fantastic!

You have to count them manually to know if you've won. Unfortunately, if I wanted to automatically show if you win, I would have had to make the post over 8.3209871e+81 characters long! I decided not to do that.

Huh, I guess technically I could maybe do some css filter magic and add a little indicator light that says if you won, but there's no way to make a win screen like there is with the lose screen.

oh dang, editing either isn't working or there's some caching or something. i noticed a bug (when you click a number tile, it should only reveal that one tile and not any connected whitespace) and it's fixed now but the post isn't updating

This was great fun! And so pretty too. It was a bit harder to not be able to flag mines, but it made me all the more proud I succeeded. Just to make sure, there isn't any way the game tells you "congrats, you've won", right? You just have to know it?

yeah, you have to count to see if the number of unclicked squares = the number of mines unfortunately. no way (to my knowledge) of implementing automatic win detection unless the board is significantly smaller or i do some svg filter magic

I'd like to shoutout "Mines" by Simon Tatham! The best version of minesweeper I've ever played- you can always win with logic- so you can focus on speed!

This Cohost version was a fun little game too! Great job.

ok it's 100% possible to implement both flagging and win detection

flagging:

  • a flag checkbox. you click it, it activates flagging mode

    • implement this by: have a summary tag for each square. clicking it toggles the contents. but the summary tag is normally positioned, and the content is a flag icon which is absolute positioned. the flag checkbox summary is absolute positioned, but its true purpose is filling up a bunch of space to push all the flags down below the game board. clicking it hides the content which lets the flags be clickable on the game board
  • win detection.

    • all the squares are currently positioned in the grid using a grid layout. instead, make all the squares absolute positioned. their true position is yet another overflow container. every time you reveal a square, it adds more height. once enough height is added, the win screen shows (tbd figure out how to actually implement this)

we still can't do:

  • making sure the start square is free
  • but what we can do is reveal a region for free at the start

and then one more thing. generate the board from https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/mines.html (16x16, 99 mines. click somewhere. note the start region. click solve)

minesweeper v2 is coming

yeah, there are a few differences in this one

  • in regular minesweeper, the first click always gives you a blank tile. i don't think there is a way for me to implement that in chostsweeper, but i can have one region revealed by default which is what i did in my development version of the next one
  • in regular minesweeper, revealing a number tile next to whitespace doesn't reveal that whitespace. this was just a bug in my code and i fixed it but for some reason the post doesn't edit anymore.

and then

  • this one doesn't detect wins. i think i know how to implement this but i haven't tried yet.
  • this one doesn't let you flag tiles. my next version supports that.