r/ProgrammerHumor • • May 23 '22

made the worst minesweeper

55.3k Upvotes

768 comments sorted by

1.5k

u/Glaiel-Gamer May 23 '22

1.9k

u/ONOMATOPOElA May 23 '22

Hey man great website but it does not work on the Nintendo 3DS browser.

631

u/PoopDev May 24 '22

Jesus Christ. Doesn’t even have basic compatability options and he wants us to take this post seriously.

91

u/Burning-Buck May 24 '22 edited May 24 '22

I bet he didn’t even make it compatible with dos either.

144

u/ragebourne May 24 '22

Not working on my Nokia 3300. Really short sighted dev.

/s

25

u/TehMephs May 24 '22

Sometimes sarcasm can be so specific the /s is implied. It’s true

9

u/judge_roughneck May 24 '22

I specifically got my free award to give this to you. Gave me a genuine lol, kudos

3

u/jakezaruba May 24 '22

Just want you to know this is the hardest I’ve ever laughed in this sub lmao

→ More replies (3)

41

u/666pool May 23 '22

In your source code lines 47 and 48 you set lmouse_down and rmouse_down but continue to use e.buttons & 1/2 in most of the function. It would improve readability to use lmouse_down and rmouse_down as these now have names which hint at the meaning of the values.

7

u/Ray57 May 24 '22

A better implementation would be to guarantee a single 50/50 shot somewhere on the board and always have you blow up.

Edit: Actually have a few of them. You get it right on all but the last one.

→ More replies (85)

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

u/ZedTT May 24 '22

This is the worst one

→ More replies (8)

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)

32

u/[deleted] May 24 '22

You're a monster.

→ More replies (3)
→ More replies (18)

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)

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)
→ More replies (11)

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.

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)
→ More replies (11)

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)

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 (3)

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.

→ More replies (7)

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)

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.

→ More replies (1)

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)

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.

→ More replies (4)

201

u/[deleted] 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

u/LostInUserSub May 23 '22

My guess too

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

u/[deleted] May 24 '22

Anywhere that doesn't have a mine

→ More replies (3)

2

u/[deleted] May 23 '22

Alternatively place mines under every single tile and only remove the extra mines after you click.

→ More replies (11)

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

91

u/DumbFish-11111010000 May 23 '22

Satan should give up his title, you're clearly worse than him.

14

u/Krikke93 May 23 '22

Dude...

8

u/BobbyThrowaway6969 May 24 '22

You should work in the gambling industry lmao

7

u/JustAnotherFurryDerg May 24 '22

Good idea but fuck you tho r/foundsatan

4

u/[deleted] May 23 '22

You invent the lottery? Powerball?

→ More replies (3)

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

u/[deleted] May 23 '22

[deleted]

5

u/NiceGuyMike May 24 '22

The only winning move is not to play

→ More replies (2)

6

u/JonathisV May 23 '22

Tell that to competitive minesweeper players! I never could break the 45 second barrier.

4

u/[deleted] 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

u/Dragoncat99 May 24 '22

Now that’s evil.

344

u/Headless_Onion May 23 '22

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

u/thundercloudtemple May 24 '22

Hey, it could be worse.

It could be Assembly.

5

u/WhyDoIHaveAnAccount9 May 24 '22

I would love to watch a video of this

→ More replies (1)

18

u/Various_Counter_9569 May 23 '22

🤣, thank you for doing this for us.

→ More replies (4)

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

u/[deleted] May 23 '22

[deleted]

→ More replies (1)

23

u/ZeroTerabytes May 23 '22

but why tho?

22

u/ToothpasteAndCheese May 23 '22

Can't fool me OP this is just normal minesweeper :(

13

u/[deleted] May 23 '22

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.

→ More replies (1)

12

u/arcx_l May 23 '22

rage quit

10

u/bladecg May 23 '22

So you always lose? Like that game where you have to climb up with a hammer

12

u/ThisIsNotKimJongUn May 23 '22

Getting Over It with (?) Bennett Foddy (?)

→ More replies (1)

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

u/The_Lego_Maniac May 23 '22

12 year old me trying minesweeper for the first time

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

u/undeniably_confused May 24 '22

I thought your first click had to be not a bomb? Oh... you made it

5

u/Mad-chuska May 24 '22

Put down 99 flags, the rest are free. Easy win.

→ More replies (5)

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

u/[deleted] May 23 '22

Son of a b...

3

u/eldritch_blast22 May 23 '22

This is truly despicable,

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

u/[deleted] May 23 '22

The Windows 3.x UI was a nice touch.

3

u/CaitaXD May 23 '22

POV you live in Bosnia

3

u/aethermar May 23 '22

Briansweeper from Windows 93

2

u/A31Nesta May 24 '22

I can't believe you are the only one mentioning Windows 93

3

u/sicknig19 May 23 '22

Skill issue

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

u/ccx941 May 24 '22

“The only winning move is not to play” -WOPR

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

u/Icy_Fish_4431 May 24 '22

Start in the corner you heathen

3

u/ZeGamingCuber May 24 '22

Ingenious

Minesweeper but the first space you click is always a mine

3

u/Random_Vanpuffelen May 24 '22

Im hearing someone screaming and destroying their windows 98 PC.

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

u/quorum10 May 23 '22

1 rule, start opening the corner

2

u/[deleted] May 23 '22

No testing when flag exceeding number of mines? I need answers

2

u/[deleted] May 23 '22

You are meant to tap the corner first

→ More replies (1)

2

u/xampl9 May 23 '22

No no! Click the one to the left!!

2

u/[deleted] May 23 '22

So, just put 100 flags down?

2

u/m_riss1 May 24 '22

I remember MattKC doing something like this where he made minesweeper literally impossible

2

u/Tro_pod May 24 '22

What would make this better is a hidden word being spelt in there

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

u/catsareboss12 May 24 '22

Just flag 99 tiles and you should be fine

2

u/DOOManiac May 24 '22

I really appreciate the authentic Windows 3.1 look. Nice job.

2

u/Real_SeaWeasel May 24 '22

I laughed too hard at this, omg.

2

u/Comfortable_Error306 May 24 '22

You sir are a fucking ass whole.. very nice

2

u/thuanjinkee May 24 '22

A strange game. The only winning move is not to play.

2

u/sanLogsIn May 24 '22

Always start with the corners.

2

u/Spider4Hire May 24 '22

No no, that is what I already experience

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

u/FourFans0fFreedom May 24 '22

This is cursed

2

u/[deleted] May 24 '22

So what happens of you place 99 flags and click?

2

u/Baffledjaffle May 24 '22

This truly is adversarial minesweeper lol

2

u/Calyde44 May 24 '22

This is just normal minesweeper right?

2

u/[deleted] May 24 '22

This is how gambling websites work

2

u/coppersense May 24 '22

Do you hate life?

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

u/YuvalAmir May 24 '22

Reminds me of absurdle

2

u/palhanor May 24 '22

if event == 'click': print('You lose')

2

u/Irdiarrur May 24 '22

I'm expecting the close button to be a hidden mine

2

u/Patient-Letterhead82 May 24 '22

ha ha veri funni

2

u/AvocadoCatnip May 24 '22

If Microsoft was Open Source we'd have had this in 1993.

2

u/Tilakksahuu May 24 '22

I'm 29 and I still don't know how to play this game.

2

u/weshuiz13 May 24 '22

Development is just 1 big mine field these days

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

u/nepumbra0 May 24 '22

What happens if you just right click 99 times? The world needs to know

2

u/FACEdroop May 24 '22

If I do 99 flags do I win?

3

u/ImportantDimension77 May 23 '22

Well, he could tell other people where not to click

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

u/[deleted] May 23 '22

Great!

1

u/dpoodle May 23 '22

At least you aren't getting out at the end like me when I play

1

u/[deleted] May 23 '22

“Everything I tried, failed”

-Hiroshi Yamauchi

1

u/[deleted] May 23 '22

You should make it so that any spaces you flag turn out to be empty

2

u/a-aa_AAA May 23 '22

He did that tho?

3

u/[deleted] May 23 '22

Whoops! Got mixed up on the symbols haha

1

u/Jess-g84 May 23 '22

I never won this game 🥲

1

u/PorquenotecallesPhD May 23 '22

I'm not a programmer but why not just

if mine Don't else Quit

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

u/zKarp May 23 '22

Just keep trying! Statistically, you can't always lose. Right?

1

u/Dolphy- May 23 '22

Looks like fun! I cann't wait to spend 12 hours trying to beat this.

1

u/poofycade May 23 '22

I dont understand

1

u/[deleted] May 23 '22

You monster.

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

u/Panical382 May 23 '22

This is so frustrating

1

u/[deleted] May 23 '22

I'm pretty good at it. I have a 50% win rate at the expert level.

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

u/buttlubber May 23 '22

It's like Tinder on single player

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

u/mistermocha May 23 '22

You monster

1

u/OkHold637 May 23 '22

xyzzy shift enter

2

u/blockchaaain May 24 '22

i acknowledge you, oh stranger who knows The Code

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

u/Riyasumi May 23 '22

What's the probability for people to get mine all the times?

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

u/bDsmDom May 23 '22

Wow bro, you suck

1

u/akorn123 May 23 '22

Haha so good lol

1

u/Forward-Elk-3607 May 23 '22

You aren't even doing it right....

1

u/[deleted] May 23 '22

I’ve never understood how to play this. I’m 42

→ More replies (1)

1

u/HKCZ_16 May 23 '22

Has anyone actually beaten this game?

1

u/Jordyboy2004 May 23 '22

Shipped with the next windows 11’update

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

u/mrwhiskey1814 May 23 '22

Couldn't I just make 100 flags and call it a win?

1

u/itsnotbob May 23 '22

I thought this was the worst minesweeper?

1

u/ELECTI_EST May 23 '22

🤣😂🤣😂.. I’m so happy I wasn’t the only one this bad🤣😂