5.4k
u/Geoclasm May 23 '22
So is this like Battle Ship where it just puts a mine where ever you click? Just randomly distributes 98 mines, then drops one mine when you click, where you click?
I'm cross-posting this to FYIP.
2.6k
u/jjdmol May 23 '22 edited May 23 '22
There's many ways to go about this, but yes that's the gist of it. As a bonus, it seems to move/not place mines wherever you put a flag. Just to further mess with you in case you just put in some wild guesses before clicking a square.
1.2k
u/iGiveWholesome May 23 '22
Or even more evil: place mines under every flag except just one so you will always almost win
1.3k
u/Zaros262 May 24 '22
Or even more more evil: guarantee that the game ends in a 50/50 pick... and rig it
388
48
u/DeepFuckingBanana May 24 '22
It lets you win once so that you will keep trying believing it is still possible.
→ More replies (3)91
→ More replies (18)32
76
u/Illeazar May 24 '22
Worst possible: set it up so that every map it creates has at least one of those areas where the best you can do is a 50/50 guess, and then when you make the guess it makes you always wrong. Then you can play for hours before even suspecting it's rigged.
→ More replies (4)→ More replies (11)26
u/postsgiven May 24 '22
Why not place 99 flags and then click a square? Won't you not get a bomb?
→ More replies (1)132
u/unclepaprika May 23 '22
Couldn't you just place 99 flags? The point is flagging all the mines, the numbers just help you get there
225
u/littlebuck2007 May 23 '22
Flagging them doesn't win. You have to clear all of the non mines for the game to complete. Sometimes that's a 50/50 shot depending on how the board is generated.
→ More replies (11)69
u/PvtPuddles May 23 '22 edited May 23 '22
The google chrome version of minesweeper is pretty good at not giving 50/50s
I’ve only ever gotten one
→ More replies (12)23
u/jjdmol May 23 '22 edited May 23 '22
The code will be forced to put a mine under a flag at some point if you place enough of them. But even with 99 flags there's enough squares to place enough mines yet never under a flag.
An easier way to think about it is this: the code only needs to reveal a solution once a square is clicked (instead of marked). So it can just invent the worst possible one given everything you've done so far, including marking squares. Nothing really forces the computer to generate a solution you start, or even before it says you failed. It can instead tailor the worst solution given what you've done, and you have no way of telling the difference, except for noticing your insane bad luck. In short, the computer just screws you as hard as it can in this game.
→ More replies (8)→ More replies (3)16
u/Nodsinator May 23 '22
It doesn't work if you flag things that aren't mines, or if there are undiscovered spots left.
→ More replies (2)→ More replies (7)23
u/someguyfromtheuk May 23 '22
Or maybe the whole thing is always mines it would look the same to the user since they always lose on the first go, and losing doesn't reveal the whole board.
20
u/Mande1baum May 23 '22
losing doesn't reveal the whole board
Yes it does. That's what all the mines that are revealed. And the flags with x's indicate spots you marked as mines that were incorrect. If you're saying that because the numbers aren't there, those can be inferred and build based on the locations of the mines.
145
u/FakingItSucessfully May 23 '22 edited May 23 '22
It's possible you know this already, but the original game actually had programming so that you couldn't lose on the first click, cause if you did hit a mine it would move it. I wanna say it was the bottom right square that had a higher chance of being mine-d, because that's where it would move a mine if you happened to click one with your first move.
45
u/Geoclasm May 23 '22
I did not know that.
Interesting.
So this is basically the reverse of that.
26
u/Mande1baum May 23 '22
Yea it's a troll version of that game where it's impossible to win, let alone not lose on the first click.
→ More replies (2)→ More replies (1)9
u/FakingItSucessfully May 23 '22
Yeah exactly. In fact I pretty strongly suspect some smartass learned about that method in class and then immediately went and programmed the evil version of it lol.
13
u/savvykms May 23 '22
Damn. Wish I knew that before when I end up with a corner as the final mine with two equally valid choices.
→ More replies (1)5
u/square_zero May 24 '22
What happens if you click the bottom-right corner on your first move and it ends up being a mine?
5
u/AndrewBorg1126 May 24 '22
This runs into the same edge case as there already being a mine where it would have been displaced to. I suspect then that it has an answer for such a scenario, and my guess is that it would increment/decrement from one corner towards the opposite corner until a valid location is discovered. I also suspect it would have been the top left, instead of the bottom right, because 0 is a more natural default state, and would not vary with the size of the board.
→ More replies (2)→ More replies (4)3
u/Proxy_PlayerHD May 24 '22
I wanna say it was the bottom right square that had a higher chance of being mine-d, that's where it would move a mine if you happened to click one with your first move.
looking at the ReplaceFirstNonBomb function in the reverse engineered source code.
it looks like when your first click is on a mine it will go looking throgh all non-clicked tiles starting in the top left corner and move the mine to the next empty one it finds.
201
May 23 '22
I think it’s more there are no mines until you click, and once you “lose” then it randomly places the remaining mines.
29
→ More replies (3)14
u/sozijlt May 24 '22
Exactly. If it randomly placed 98 mines first, and then one where you click, you could have clicked one of the 98 mines and then where does the 99th go? Your description is the only logical way I see.
15
→ More replies (11)2
May 23 '22
Alternatively place mines under every single tile and only remove the extra mines after you click.
952
u/Tallyoyoguy42 May 23 '22
Need to force the rare case of a 50-50 on each playthrough and then force it to be a bomb. That way you think you have a chance when you don't
378
u/Lamkac May 23 '22
Don't worry, I have already done it
https://www.reddit.com/r/ProgrammerHumor/comments/adwqm9/i_made_minesweeper_clone_where_every_game_has/3
→ More replies (5)3
91
14
8
7
→ More replies (3)4
786
u/Existing_Ice1764 May 23 '22
This is just streamlining to the experience we all end up having anyway.
122
u/ss0889 May 23 '22
I believe the words you are looking for are "optimal solution"
0
6
u/JonathisV May 23 '22
Tell that to competitive minesweeper players! I never could break the 45 second barrier.
4
May 24 '22
I had a good friend in HS who was insanely fast at mine craft. She would be clicking nonstop, no hesitation and my brain could never keep up
5
u/JonathisV May 24 '22
It's all pattern recognition and muscle memory. Once you work out the various algorithms, your brain has to learn the number colors and flag combinations. After that, well it's all a matter of seconds. One of my coworkers got me into it. He hated me for a while because I showed him a few tricks to solve more puzzles (success rate from 30~% > 70~%), but caused him to loose a whole 30+ seconds from his average times because he had to retrain his muscle memory. I evil laughed at him for weeks.
114
u/T_D_K May 23 '22
You should program it to have a small chance of generating a "normal" board, that is guaranteed to have an unsolvable corner. And then make that final corner adversarial.
17
344
u/Headless_Onion May 23 '22
Almost won.
https://imgur.com/a/SrKc7xc
146
u/Lucasbasques May 23 '22
Thank you for saving me the time to do that, now back to programing tetris in R
69
u/cicciograna May 23 '22
So, do you like also being spanked or is just a niche form of masochism you have?
14
→ More replies (1)5
→ More replies (4)18
32
u/analogic-microwave May 24 '22
Square square = getWhereTheMousePointerIs( );
square.createMine( );
//LiterallySatan.java
151
u/giant-Hole May 23 '22
This is actually genius
29
u/TimShanMoran May 23 '22
Yes, yes it is
8
u/Mr_Rawrr May 24 '22
Not sure how feasible, but I feel like it'd be extra cool if they didn't choose where you clicked to put a mine - but instead it would be trying to follow your cursor around (with a lag) and putting a mine down if you've spent more than a half second with the cursor on the square. But also having 90% mines placed already randomly.
0
23
22
13
May 23 '22
2
→ More replies (1)2
u/luke_in_the_sky May 24 '22
LOL I did the exact same thing with a Flash executable a long time ago. Not the as complex though. It was just an interactive screenshot that emulated the game.
12
10
u/bladecg May 23 '22
So you always lose? Like that game where you have to climb up with a hammer
12
6
u/db2 May 23 '22
I think it's called "naked hook hammer pot guy". 🤡
6
u/TheHueman May 23 '22
How are you still on reddit after 14 years
19
u/db2 May 23 '22
I'm not, I died in 2012. This is an AI based on an active brain scan conducted over a year. The movie Transcendence is based on me.
10
5
u/jonnysh May 24 '22
no, the worst minesweeper is when you have to solve 98% of the field before being left with a pure luck 50/50 choice that is always wrong.
5
5
4
1
u/Dowzer721 May 24 '22
I never understood what the pressing down 9 squares button was for. Don't know how better to describe that
1
u/Glaiel-Gamer May 24 '22
if you did it on a number square where you already flagged exactly enough mines around it, it would click all the unflagged ones automatically
3
3
3
u/RitmanRovers May 23 '22
Never understood minesweeper. I was more solitaire and then pinball came to Windows wooaahhh I was a demon at that game.
3
3
3
3
3
u/blagoonga123 May 24 '22
You should make it very occasionally let you click without dying, but it shows that every mine around where you clicked is a mine, so you're still no better off
3
u/beeyonetta May 24 '22
I watched this 3 times before I realised it was only a 20 second long video and not a minute long
3
3
u/VforVendetta33 May 24 '22
You should make it occasionally reveal clearings with 100% mines all around, then proceed to explode on the second guess. You know, to give the illusion of chance before crushing them again.
3
u/aggracewhiff May 24 '22
Not my proudest fap
3
u/Only-Neighborhood-97 May 24 '22
Damn you really sat there and thought about what the funniest possible joke would be before farting that one out didn't you?
3
3
3
3
u/Sebetastic May 24 '22
Upload it to Google Play / App Store / Microsoft Store and present it as regular minesweeper. Don't forget to charge money for it and fill it chock-full of ads.
2
2
2
2
2
2
u/m_riss1 May 24 '22
I remember MattKC doing something like this where he made minesweeper literally impossible
2
2
u/thedarkhaze May 24 '22
If you're going to do this might as well have it spell out a message with mines to really rub it in.
2
u/ThirdWurldProblem May 24 '22
You could make it better by having some of the mines always make an "F U" somewhere.
→ More replies (1)
2
2
2
2
2
2
2
2
u/_Tal May 24 '22
Just flag the entire board. EZ
2
u/Geoclasm May 24 '22
Nope. But you can 'win' by leaving 98 tiles unflagged, clicking one tile which you know will have a mine under it, and revealing that somehow the other 98 mines were all under the unflagged tiles.
How's that a win? Well, you knew where every mine was, and that's the point of the game - to 'know' where each mine is. Unfortunately, you can only prove you know by 'losing', therefore winning by losing.
→ More replies (1)
2
2
2
2
2
2
2
u/VeryPogi May 24 '22
Microsoft should make this the default minesweeper until Windows has been activated
2
u/Xiterok May 24 '22
Easy: just click the flag 99 times and then click the rest - you can also create beautiful designs
2
u/PsychologicalMud4091 May 24 '22
The amount of people in here that don't know how to play minesweeper is making me feel incredibly old.
2
u/golgol12 May 24 '22
What happens if you put out 100 flags. One of those spots has to not be a mine.
2
2
2
2
2
2
2
2
u/Razorfiend May 24 '22 edited May 29 '22
If the number of mines is fixed at 99 then couldn't you just place 99 flags then clear the rest of the board with no issues? Right now it seems like it places a mine under every flag.
2
u/travlerjoe May 24 '22
What happens if you fill the map with flags except 1 square? Will the program crash
2
2
2
3
2
u/Various_Counter_9569 May 23 '22
Am I the only one that went straight to page source and open a console???
1
u/ISeemToExistButIDont May 24 '22
In the original game, the mines are randomly generated after your first click, but a mine is never put in the square where you first clicked; here it's similar, but a mine is always put where you first clicked.
1
1
1
1
1
1
1
u/Innominate8 May 23 '22
It would be interesting to see an evil but winnable minesweeper that creates as many ambiguous mine placements as possible.
1
1
1
1
1
1
u/GeorgeU55 May 23 '22
There is a way to win tho. You see that x button in the top right corner? You press it and then there won't be any mine close to your cursor.
1
u/dr_toze May 23 '22
Reminds me of when i got bored and played reverse minesweeper. Custom setting 999 mines on a 10 by 10 board which defaulted it to something around 400 on a 20 by 20 so you had this but only about 5 correct first presses.
1
1
1
u/Potential-Matter-403 May 23 '22
That is gloriously evil. Please post this program so that we can mess with our aging parents
1
1
u/psaiful28 May 23 '22
LOL, my mom would lose it trying to play this, I should pull a prank on her haha.
1
1
1
u/Thisbymaster May 23 '22
If you hold both buttons of the mouse in a section without bombs then it will open the area.
1
1
u/WouldMakeBrook May 23 '22
Just tried flagging every square but one and still lost... And now my trainment arc begins to win this game of minesweeper
1
1
1
1
1
1
1
1
u/randomkeystrike May 23 '22
You could adjust the number of squares in the grid and the number of mines. There was a constraint on how few or how many, if I recall, but you could make them ludicrously easy or ludicrously hard.
Was there a setting where you could ensure the first click was mine-free? I don’t remember.
1
1
1


1.5k
u/Glaiel-Gamer May 23 '22
https://www.glaielgames.com/adversarialminesweeper/