I made a self-solving Minesweeper screensaver

  Рет қаралды 137,820

Have a Luke at this

Have a Luke at this

Жыл бұрын

Minesweeper is a pretty satisfying game to play, but it's even more satisfying to watch some code play it for you.
If you'd like to play with the code yourself you can download it here:
github.com/haveaLukeatthis/Se...

Пікірлер: 191
@xdarin_
@xdarin_ Жыл бұрын
"When the autosolver is confused, it will guess and pick a random tile, usually failing" Realistic.
@-Name-here-
@-Name-here- Жыл бұрын
Yeah
@tec-jojo6424
@tec-jojo6424 Жыл бұрын
me too solver, me too
@David__U
@David__U Жыл бұрын
Although there are some places where your guess would be "1 out of 2" but maybe another spot would be "2 out of 3" , or maybe even as good as "7 out of 8" . So a guess shouldn't really be random out of all of the remaining tiles.
@xdarin_
@xdarin_ Жыл бұрын
@@David__U usually i click random tiles when i don't get an opening at the start
@bonbonpony
@bonbonpony Жыл бұрын
Isn't it what a non-auto solver do as well? :J
@brnddi
@brnddi Жыл бұрын
For more effective screensaving, you'll want to randomly offset the lines so they aren't in the same place every time. Possibly also lower the contrast. For LCD screens, you'll probably want a light theme, as white pixels are the "relaxed" state for LCDs (AFAIK). For OLED, you'll want a dark theme.
@mikoajp.5890
@mikoajp.5890 Жыл бұрын
the line offset can be handled by randomizing board size
@somewhere-else
@somewhere-else Жыл бұрын
if the whole thing scrolled infinitely diagonally and just kept solving it would screensave better And be so so satisfying
@NickWrightDataYT
@NickWrightDataYT Жыл бұрын
I knew someone who coded themselves out of games. This was around when Sudoku first became popular--he basically said "if I can fully solve Sudoku by programming a solver for it, I've effectively solved every Sudoku ever, and I never have to play the game again. Same for every other solvable game." (I assume he was at the time asked a lot if he played lol)
@paradox9551
@paradox9551 Жыл бұрын
Except that sudoku is actually really hard to solve efficiently if you scale it up massively, unlike something like minesweeper which scales up linearly Sudoku is an NP problem as far as we humans know, like it's really difficult to solve massive boards of sudoku in any reasonable amount of time for a computer
@NickWrightDataYT
@NickWrightDataYT Жыл бұрын
@@paradox9551 solving a classic 9x9 board of Sudoku is a solved problem, and I'm pretty sure that's what the guy was referring to, not having an arbitrary board size.
@TF2Llama
@TF2Llama Жыл бұрын
Minesweeper is also np
@bitcoinweasel9274
@bitcoinweasel9274 Жыл бұрын
@@paradox9551 I once made a sudoku solver, trying to solve it like a person would. Implementing my strategies was really hard, and it would get stuck on harder puzzles. Then I implemented a simple recursive algorithm that solved it insanely fast that was also easy to implement. It was very amusing, but also disheartening.
@vorpal22
@vorpal22 Жыл бұрын
Yep... this is what I do. I have played a lot of Sudoku in the past, but then lost all interest in playing it, and only had interest in using lots of different programming techniques (simple backtracking, more advanced backtracking like Knuth's DLX algorithm, constraint programming, heuristics, evolutionary algorithms, swarm algorithms, neural nets, etc) to solve Sudoku boards and to analyze the mathematics of Sudoku. (I'm a combinatorial design theorist, and given that Sudoku is a great combinatorial design with many representations such as graph colourings, it was inevitable.) There's a great book, Taking Sudoku Seriously, which I recommend for anyone interested in the math of Sudoku. I dislike games that cannot be posed cleanly as combinatorial design problems, such as some of the "variants" of Sudoku.
@foxwhite25
@foxwhite25 Жыл бұрын
To improve the style of the code, I have a few simple suggestions, you can improve the indentation wall by refactoring the if condition statement to if not condition return/continue. Also, the part that checks for nearby cells can be refactored to iterate over a delta vector and extract it into a function, which seems to be used in many places. Happy coding :)
@HaveaLukeatthis
@HaveaLukeatthis Жыл бұрын
Thanks for the suggestions, I'll have a look into this!
@redcrewmate1813
@redcrewmate1813 Жыл бұрын
@@HaveaLukeatthis instead of implementing a bunch of rules, you could calculate the chance of each square being a mine, then choose the square with the least chance. 1000 iq
@Tom-cq2ui
@Tom-cq2ui Жыл бұрын
@@redcrewmate1813 Huh... If only I didn't have too many projects on my hands :D I would love to see a real-time display of a solver with a color gradient filter over the board which shows which parts are the most risky at the moment. I would also be interested to see how reliable this method is, just for science.
@nicolasxd7717
@nicolasxd7717 Жыл бұрын
@@redcrewmate1813 i know this is more for fun, but if they really wanted a screensaver that you are not supposed to play they could have just made the autosolver know where the bombs are so it cant fail tho this method probably looks more realistic
@CYON4D
@CYON4D Жыл бұрын
I feel like CodeAesthetic has an influence here :)
@silasnebulous4533
@silasnebulous4533 Жыл бұрын
Actual great hook, made me want to watch the entire video from the start. Please make more videos!
@HaveaLukeatthis
@HaveaLukeatthis Жыл бұрын
Thanks! I've got a few more projects I'm working on at the moment so will hopefully have another video out soon
@perfectionbox
@perfectionbox Жыл бұрын
When i get to ambiguous areas, i find probability analysis useful to increase my chances
@vermilisix
@vermilisix Жыл бұрын
You can always play a version that ensures solubility without guessing
@perfectionbox
@perfectionbox Жыл бұрын
@@vermilisix I actually like the ambiguous moments, it's a lot like life. Sometimes you gotta take a chance, and sometimes you screw up 🤣
@aierce
@aierce Жыл бұрын
Those areas can sometimes be solved by counting total bombs left
@Renteks-
@Renteks- Жыл бұрын
@@aierce Not always. If you're left with a 50/50 at the end with one bomb left, bomb count doesn't help, although it can solve some problems.
@accursedcursive4935
@accursedcursive4935 Жыл бұрын
4:31 The solver appears to have revealed a 6, revealed a tile that was obviously a bomb as there were only 6 unrevealed tiles next to the 6, and then proceeded to flag another tile before the solver's failure fully registered.
@stevebabiak6997
@stevebabiak6997 Жыл бұрын
Good catch. That shows the solver has flaws in it.
@evilbob840
@evilbob840 Жыл бұрын
I'm assuming the AI was guessing one of the tiles to the north of the 6 and then revealing all the other tiles based on the 2, either to the east or west of the unknowns, having two flags next to it. It hit the 6 first, but was still in the function to reveal all unmarked tiles, so it didn't realize the 6 showed that the guess was wrong. You'd have to code it to check the "standard" logic for each tile reveal caused by a guess, possibly reverting the initial guess in the process.
@janisir4529
@janisir4529 Жыл бұрын
I sometimes played this game, but ultimately when I actually had the patience to try solve a hard board, I always ended up in a situation where I had to guess, and always got it wrong...
@ladyravendale1
@ladyravendale1 Жыл бұрын
Amazingly high quality for a channels second vid. I would gladly watch more videos of you coding things.
@jackrangaiah4236
@jackrangaiah4236 Жыл бұрын
3:20 that 3 in the 3rd row on the left side is giving me so much anxiety
@neilwilliams4684
@neilwilliams4684 4 ай бұрын
LOL. Good spot!
@kitniec4540
@kitniec4540 Жыл бұрын
Thank you for explaining minesweeper in such a clear manner, I always had trouble figuring out what the numbers actually meant.
@NotPhoenic
@NotPhoenic Жыл бұрын
Never wouldve guessed this was a small channel, amazing work
@greenix4254
@greenix4254 Жыл бұрын
Love the result. Very smart way at speeding it up, as well.
@robbkenobi
@robbkenobi Жыл бұрын
Dude this is awesome. Subscribed!
@havesomeslav
@havesomeslav Жыл бұрын
Looks great, you've earned a subscriber. Keep it up!
@fejfo6559
@fejfo6559 9 ай бұрын
I recommend the game "14 minesweeper variants" it has a built in SAT solver to procedurally generate puzzles that require complicated logic
@MThomasB
@MThomasB Жыл бұрын
I like this and I hope you get even more followers. Subscribed.
@nothappyz
@nothappyz Жыл бұрын
Awesome quality, keep up the good work
@IsYitzach
@IsYitzach Жыл бұрын
Code Bullet looked at the problem 4 years ago. His solving algorithm is a bit more fancy than yours. If it finds a case where 1 in 3 configurations has a bomb while its neighbors have bombs in 2 in 3 configurations, it will select the 1 in 3 location instead of the 2 in 3 locations reducing the likelihood of bombs going off.
@Biztsar
@Biztsar Жыл бұрын
Underrated I can't believe that you don't have 1k subscribers yet
@cyborgryno6038
@cyborgryno6038 Жыл бұрын
So that's why the 3D pipes screen saver was so popular!
@unrellated
@unrellated Жыл бұрын
Sometimes, a minesweeper puzzle is actually unsolvable. If your solver finds one of these, I suggest having it cheat a little and give itself a hint, revealing a clear tile.
@sparky5817
@sparky5817 Жыл бұрын
241 subscribers? This video was amazing keep it going bro I believe in you
@SkyboxMonster
@SkyboxMonster Жыл бұрын
I wanted to create my own puzzle solver engine for a puzzle game that I dont know the name for. its a grid of pipes and ends. all you can do is rotate the blocks in place to move the connections around. everything must connect to the center tile. I learned quickly that the edges should be solved first since all edge tiles cannot have a connection. so any "T" shape must always face inwards. allowing you to "lock" the tile and mark it as solved. I thought it would be a fun task to make a program that would solve the puzzles
@ixamplays681
@ixamplays681 Жыл бұрын
Wow, I had the same idea over a year ago but had to abandon it due to horrible code base. Thanks for making this!
@rhodykoop7672
@rhodykoop7672 Жыл бұрын
What if you tried alternative tile shapes? Like hexagons or triangles? Maybe even alternative spacial geometries like the surface of a torus or a cube? That'd be cool, and probably a fun challenge to figure out lol
@ash.mystic
@ash.mystic 9 ай бұрын
Yes this is a cool idea!
@MrSaemichlaus
@MrSaemichlaus Жыл бұрын
For the logic around the 02:40 mark, it would make sense to pause the normal "iterating over a bunch of tiles to look for trivial solves" and to look specifically around the two cells forming an XOR and examine the surrounding cells with that characteristic in mind. That way you could blast through most cells very quickly and only apply advanced logic when needed.
@douggale5962
@douggale5962 Жыл бұрын
Years ago, I made my sister an automatic solitaire game, that played automatically. It was good, too. She didn't think it was as funny as I did.
@bastian1847
@bastian1847 Жыл бұрын
Very cool! The original minesweeper had a maybe flag that I used extensively :⁠-⁠)
@markcoleman9892
@markcoleman9892 Жыл бұрын
I played this obsessively when it first came out - so much so that I "used" it to think about other things, keeping the overactive part of my brain occupied. When it became too "easy," I stopped dropping bomb markers so that I had to rely just on the number patterns. It was especially satisfying to finish a board with no bomb markers in view. He left out that the original game displays a count of the total bomb markers remaining, which was one of the parameters for resetting the board. Getting to only 5 bombs left and 20 or 30 unmarked squares made it easier to guess safely. The original game "cheated" in that the very first square was ALWAYS NOT a bomb - which means the pattern couldn't be set until AFTER the players first move. (A few times, the first click revealed an 8, though, making the next click VERY risky! 😁
@hochimichi
@hochimichi Жыл бұрын
Bruh how tf does this only have 94 views. Very impressive stuff keep it up 👍
@HaveaLukeatthis
@HaveaLukeatthis Жыл бұрын
Thanks very much, I appreciate it!
@kristoff_t2013
@kristoff_t2013 Жыл бұрын
It has 3.1k views now.
@dustysparks
@dustysparks Жыл бұрын
I did the same thing with my Sudoku solver (which will also do puzzles that overlap/have common squares). I don't do the exhaustive search from the ComputerPhile videos (he did his in Python as well), but rather tried to articulate "what do I do when I solve?" into algorithmic checks of escalating complexity (Level 1, look for the obvious. Don't find any? Level 2, look for slightly harder to find things. Only make a few pencil marks? Level 3... etc. Every time an actual guess is made I drop all the way back to Level 1 complexity and start over until I've exhausted all techniques without any guesses or new pencil marks). It doesn't know advanced techniques because... well... neither do I hehehe nor could I articulate those techniques I don't think, but it does pretty well.
@darthbob88
@darthbob88 Жыл бұрын
Liked for your sharing the code.
@olepigeon
@olepigeon Жыл бұрын
This would make for a fantastic After Dark screensaver.
@AlonzoTG
@AlonzoTG Жыл бұрын
yeah, the part at 2:30 is what I call the law of 1-2-1. Wherever you see that pattern, or anything that reduces to that pattern, then the flags go adjacent to the 1's and the center is cleared and depending on how you arrived at 1-2-1, you may also clear whatever is on the other side of those 1's.
@cliftonchurch6039
@cliftonchurch6039 Жыл бұрын
Okay, different angle on solving the maybe situation in plaintext: Until a new number is revealed, treat each cell as a rolling percentage of likelihood of a bomb. The first 2 knows that those two cells each have a 50% chance of being a bomb, so for the value of "likelihood of a bomb" set a value of 0.5, and move onto the next digit down the line. The next two adds up the values of all cells it sees to get the total likelihood of bombs placed, reading flagged bombs as a 1, and numbers, spaced, and unclicked cells as 0. It sees that the likely number of bombs placed is 1 (if it were somehow 1.25 or something, it would truncate at the ones place, and do the math from there) so it knows that in any 0 likelihood unclicked cells it sees, they must hold *number in cell* minus *bombs placed value* bombs. in this case there's only one 0 probability unclicked cell the number sees, so it puts all 1 bomb into that cells value. Then the logic decided if flags must be placed. Any cell who's probability of a bomb is one or greater, gets flagged as a bomb, so the cell directly in front of the 1 gets flagged. The logic then reverses the order of thinking and says "does this cause any number I'm touching to be maxed out?" If it finds more than one, that doesn't matter, but if it doesn't find any, the logic would have then continued down the line of numbers, erasing memory of values holding probability of a bomb, continuing to try and find a maxed out number. When it maxes out a number, that number flips all remaining unclicked cells to safe, then starts the process all over again. I'm the kind of guy who feels like he's good at talking out programming logic, but no good at actually writing it. I have no idea if that's a valuable skill, and I'm just hopeful that I made some level of sense, and all respect for having the knowledge to make that programming happen. I hope the idea helps get the juices flowing, should you want to try to make your code leaner.
@marklandgraf7667
@marklandgraf7667 Жыл бұрын
Chopin is a nice touch
@QUASAR098
@QUASAR098 Жыл бұрын
very well made video!
@sbrunner69
@sbrunner69 Жыл бұрын
Oh snap. I might have to code this in c#. Years ago I got bored and coded reversi client server over tcp. That was fine and similar logic with checking neighbors.
@TheHDreality
@TheHDreality Жыл бұрын
I have a suggestion for you, I'd implement it but I only have my work laptop atm and can't download anything executable. Make an infinite scrolling mineweeper solver, prioritise solving on the left of the screen, and when the whole let edge is solved move one over, repeat infinitely.
@robo-zx
@robo-zx Жыл бұрын
really cool actually!
@temporaryname6509
@temporaryname6509 Жыл бұрын
Only 12 subs? This channel is super underrated I will be the thirteenth sub
@HaveaLukeatthis
@HaveaLukeatthis Жыл бұрын
Thanks, appreciate it!
@bonbonpony
@bonbonpony Жыл бұрын
This already looks better than may of those crappy screensavers in Linux's Xscreensaver :q
@goldenredstone04
@goldenredstone04 Жыл бұрын
I made a minesweeper screensaver a couple of years ago. I made mine scroll infinitely so it looks like an infinite minefield. I also cheated a little and let it choose a random safe tile to clear when it was stuck.
@Geenimetsuri
@Geenimetsuri Жыл бұрын
This made me want to play minesweeper
@Tezla0
@Tezla0 Жыл бұрын
You can make it 100% solvable since you create the field and therefore know where the mines are. When your solver is stuck, "guess" any empty tile, or one that is next to an empty/number tile.
@unflexian
@unflexian Жыл бұрын
Amazing! Are there any situations where two hypotheses are required? like, assuming one tile is maybe cleared reveals some data but not enough, so you need to assume/guess about another tile inside the first assumption?
@michaelhutson6758
@michaelhutson6758 Жыл бұрын
At least at the mine density I always play for custom games (= ratio for expert game, or one mine per 4.8 tiles) I almost always end up with multiple 50/50 guesses unsolvable by logic so it becomes having to win (N) coin tosses.
@durden91tyler
@durden91tyler Жыл бұрын
"hi, i made a" is its own genre now. what a world.
@tristanlifshitz7368
@tristanlifshitz7368 Жыл бұрын
Now all we need is a dark version
@havenselph
@havenselph Жыл бұрын
Fun fact, you actually only need the global flag on a variable if you want to set a variable from an outer scope. Python actually propagates outwards and finds the first scope with a matching reference. You only use global when you want to write to the highest form of a variable, usually a global. It's actually frowned upon to use globals usually, as it makes it difficult to see where a variable has been changed at, but that doesn't mean it has no use, obviously it's there for a reason. Anyways, thought I'd let you know about that, cheers!
@fantastikboom1094
@fantastikboom1094 Жыл бұрын
3:56 Um, why this image is so wrong...
@olegmoki
@olegmoki Жыл бұрын
Wait... Oh yeah it's wrong
@xdarin_
@xdarin_ Жыл бұрын
Number 5 tiles didn't exist in ms minesweeper, right?
@fantastikboom1094
@fantastikboom1094 Жыл бұрын
@@xdarin_ there's another problem: tile 2 above that 5 can't exist because there are 3 mines near it. And two upper 2s can't exist too, because they have only 1 bomb nearby.
@HaveaLukeatthis
@HaveaLukeatthis Жыл бұрын
@@fantastikboom1094 The 2 above the 5 is actually OK - the 5 is currently surrounded by 6 unrevealed tiles (one of which is flagged). The three tiles below the 5 are all bombs and the tile to the left of the 2 is also a bomb, the tile to the left of the 5 however is clear. As for the upper twos that is just the way I took the screenshot - the grid actually extends beyond the edges of this shot, sorry for the confusion!
@Demigodess42
@Demigodess42 Жыл бұрын
At 2:23, there's a 3 along the left side that can't have 3 mines next to it. There are only two places to put mines next to it. The 2 along the left side isn't possible either.
@T-WaL
@T-WaL Жыл бұрын
He leaves it on screen for nearly ¼ of the video! 3:53
@philmenzies2477
@philmenzies2477 Жыл бұрын
Also the 2 above the unsolved tile cannot be a 2 as the other adjacent tiles are all solved, leaving only 1 possible bomb
@_raylo
@_raylo Жыл бұрын
yeah that whole example was just wrong
@SP-ny1fk
@SP-ny1fk Жыл бұрын
Get the puzzle generator to talk directly with the puzzle solver and cut out that thing in the middle
@malcolmkoharian
@malcolmkoharian 9 ай бұрын
you should make a 10-hour video of the robot solving it. maybe it could have music or something?
@steves5476
@steves5476 Жыл бұрын
You can use something like convolutions to solve this. Store a probability value for each unrevealed tile neighboring a revealed tile. For all revealed, numbered tiles, offset the probability values of their unrevealed neighbors so they add up to the value they show. When an unrevealed tile is neighbor to N revealed numbered tiles, average their offsets computed by their neighbors. Repeat this until convergence. Reveal the tile with the lowest probability. Repeat until all tiles with a probability less than 0.5 are revealed.
@micahhaveman7682
@micahhaveman7682 Жыл бұрын
Man you need more than 30 subs
@micahhaveman7682
@micahhaveman7682 Жыл бұрын
I guess all I can do is add 1
@olegmoki
@olegmoki Жыл бұрын
fr he has 31 subscriber
@sssamalander
@sssamalander Жыл бұрын
Please put this on a webpage so I can make it my desktop wallpaper!
@aamyushh
@aamyushh Жыл бұрын
wayy too underrated
@toolbgtools
@toolbgtools Жыл бұрын
by assigning entropy to each square is best method to solve minesweeper. like reveled square has entropy 0. distribute value of square to surrounding not reveled squares. like if there are 2 not reveled squares around '1' then give them 1/2 & 1/2 entropy. squares having entropy 1 is bomb.
@SetTheCurve
@SetTheCurve Жыл бұрын
It would be nice if you would design an always beatable minesweeper. I’ve heard they’ve been programmed but never seen one.
@Dero_Zero
@Dero_Zero Жыл бұрын
I feel called out by the intro lmao
@derekborders9647
@derekborders9647 Жыл бұрын
It would be interesting to set this up to scroll infinitely
@farianderson168
@farianderson168 Жыл бұрын
Counting the bombs also helps at dead-ends
@koppadasao
@koppadasao Жыл бұрын
2:23 That's an odd number 3... On the edge, with 4 of 6 spaces revealed....
@morphious86.
@morphious86. Жыл бұрын
all things considered this is really cool! though it defeats the main purpose of a screensaver, since there's many static elements that would burn into your screen
@TweeTV_
@TweeTV_ Жыл бұрын
Made my day :)
@Mightybro675
@Mightybro675 Жыл бұрын
Would there be any possible way you can make a dark mode version of this, and upload it Wallpaper Engine? I would like to have something like this as a Wallpaper Engine application.
@CallousCoder
@CallousCoder Жыл бұрын
Very well done!!! Why is it that our type of channels have so few subscribers? Is it that it's too niche? Too nerdy? Too complex?
@mdkarim831
@mdkarim831 Жыл бұрын
Wow I never considered an algorithm that solves via proof by contradiction. How quaint
@zombathinlostleghackercat5233
@zombathinlostleghackercat5233 Жыл бұрын
Do a 100x100 grid with 10,000 bombs. Then do another with 9,999 bombs.
@zombathinlostleghackercat5233
@zombathinlostleghackercat5233 Жыл бұрын
Nice.
@ikocheratcr
@ikocheratcr Жыл бұрын
I have been toying with the idea to make a solver, but the purpose is to create 100% solvable games, where if you play fully by logic you do not need random to finish it. One thing I see is that the opening move needs to be "pre played", ie one does not choose the first click.
@skyyoshi86
@skyyoshi86 Жыл бұрын
could the board be created/populated AFTER player's first click, making the solver define as bomb-less the tile that the user decided to click when the game began?
@RandomStuff-qf7gp
@RandomStuff-qf7gp Жыл бұрын
nice
@stevebabiak6997
@stevebabiak6997 Жыл бұрын
The board at 3:39 is not possible IMO. The lower number 3 on the left being on the edge of the board implies that the two tiles to the right of it are explosives, as well as the tile directly beneath it. So the number 2 gets satisfied by the two tiles that were to the right of that number 3 - but then there has to be an explosive directly below the number 1 to the right of that number 3, which then means there are three explosives on the perimeter of that number 2. That number 2 should therefore be a 3. Or there must be more tiles to the left of that lower number 3 (it can’t be on the edge of the board).
@igornuto
@igornuto Жыл бұрын
Luke, would you mind telling what happens if the algorithm stumbles on a 50/50 guess? I remember getting some 50/50 when I used to play the game.
@HaveaLukeatthis
@HaveaLukeatthis Жыл бұрын
If it gets to a point where a guess is required it just picks one at random and reveals it - if it happens to be a bomb then it will fail and start over with a new set of bombs
@barutaji
@barutaji Жыл бұрын
@@HaveaLukeatthis An improved version could make an probabilistic analysis once it gets stuck. Then you achieve the "perfect" solver, with the highest probability of success.
@igornuto
@igornuto Жыл бұрын
@@barutaji that sounds cool, but sometimes the probability of the bomb does not change by the order of the square you open :(
@barutaji
@barutaji Жыл бұрын
@@igornuto You can calculate the probability of having a bomb for every closed square and chose the least probable. If there is more than one with the same probability, than pick randomly between the options. After that try to restart the deterministic algorithm and see if it can go further. If not, make another statistical analysis and see if something changed with the new information. Rinse and repeat. You can't achieve certainty on a general board, but at least you can minimize the risk to an absolute minimum.
@HeroOfHyla
@HeroOfHyla Жыл бұрын
@@HaveaLukeatthis There are some minesweeper implementations where the generated boards are guaranteed to be fully solvable with no guessing required. I know Simon Tatham's version is like that for example.
@xamarinmaster1403
@xamarinmaster1403 Жыл бұрын
You should try to write a solver for SkiaLogic type puzzles.
@martindorrance8133
@martindorrance8133 Жыл бұрын
It’s proof by contradiction!
@kenan2386
@kenan2386 Жыл бұрын
Only 800 subs? Come on! Take mine!
@NotAGeySer
@NotAGeySer Жыл бұрын
Nice
@zperk13
@zperk13 Жыл бұрын
Maybe a Tetris solver will please your brain similarly
@michaelmoore7568
@michaelmoore7568 Жыл бұрын
Did you model this with a Markov Model and/or a Bayes Net?
@justanon8567
@justanon8567 Жыл бұрын
remember me when you get big :)
@johnydl
@johnydl Жыл бұрын
infinite scrolling mine sweeper, it tries to solve the top-most cells it can, it can't reveal anything about the bottom row of cells, every time a top row is cleared shift everything up and add random bombs, maybe keeping the top 3rd ish solved and slowly scrolling and adjusting the speed of the solver to keep about 2/3rds +/-5% of the cells solved at any given time
@FUNDUDZZ
@FUNDUDZZ Жыл бұрын
neat!
@MisterBoat
@MisterBoat Жыл бұрын
3:40 the top 3 is wrong, there are only two tiles in its vicinity and no flags
@ookamiueru
@ookamiueru Жыл бұрын
There are more wrong things with it as well. I stopped the video here, made this comment and left.
@noahhewett6294
@noahhewett6294 Жыл бұрын
​@@ookamiueru pretty sure this is just a cropped section of a whole board Einstein
@tensorflaw
@tensorflaw Жыл бұрын
What is the time complexity of the solver?
@chadliu5005
@chadliu5005 Жыл бұрын
At 2:45, that board is not possible. Reasons being is that 1. Because we can clearly see that the two sides of the board both show borders, therefore the top 3 cannot be possible as there are only 2 mines surrounding it in an 3x3 area (excluding the border ones). Thus the top 3 cannot be possible. 2. The bottom 3 is possible as it shows that there are 3 mines surrounding it and that there are only 3 available tiles, however using that logic, the 2 beside it will also be clear, leaving the 2122 pattern being like: 3 * 2 1 2 2 * * * x x * * 2 As you can see the top right most 2 cannot be possible as there are 3 mines beside it based on the boards logic
@HaveaLukeatthis
@HaveaLukeatthis Жыл бұрын
The borders you can see in the image are not actually the edges of the grid, it's just the way I took the screenshot. Sorry for the confusion!
@chadliu5005
@chadliu5005 Жыл бұрын
@@HaveaLukeatthis Ah okay! Sounds good haha, thought it was quite weird as you do seem pretty experienced in minesweeper haha
@theob1712
@theob1712 Жыл бұрын
Wait this whole time its been "bombs in the surrouding 8 squares" and not "spaces away that the nearest bomb is"? Wow I've been playing wrong
@olegmoki
@olegmoki Жыл бұрын
This is pretty nice!.. So, can i use it as a screensaver?
@HaveaLukeatthis
@HaveaLukeatthis Жыл бұрын
You can download the python code from the description and configure it to run full screen but its not technically a screen saver at the moment - I'm looking into a couple of ways I might be able to turn it into an actual screen saver though
@snowwsquire
@snowwsquire Жыл бұрын
@@HaveaLukeatthis .scr files are just exes so if you compile the python into one it should work as long it goes full screen by default
@ykaaaaar
@ykaaaaar Жыл бұрын
How do you only have 1k subscribers
@broganplayz153
@broganplayz153 Жыл бұрын
This is cool as fuck
@DaRootBeer1231
@DaRootBeer1231 Жыл бұрын
Is their any way to turn this into an actual screen saver?
@TheMadMurf
@TheMadMurf Жыл бұрын
What happened at 5:11? It looks like the solver hit a bomb next to a two tile? Why would it be guessing when the 2 is only touching 2 squares?
@RichConnerGMN
@RichConnerGMN Жыл бұрын
wallpaper engine when?
@xinfinity4756
@xinfinity4756 Жыл бұрын
2:23 top left most three shouldnt be there, since only two spaces around it are undiscovered and none of the discovered spaces are bombs.
@chrissdehaan
@chrissdehaan Жыл бұрын
I don't mean to nitpick, but the board at 5:11 had a tile that could have been confidently cleared, but the game guessed (and blew up.) In the top right, there is a 4 with an unflagged bomb below it. 2 tiles to the right of that bomb could have been cleared, given what was known at the time. My Python isn't very strong, so I doubt I can realistically dig up why the code didn't find that.
@luizalbertolausdarosa6819
@luizalbertolausdarosa6819 Жыл бұрын
True, I could not make a configuration where the numbers shown remained valid if a bomb was in that square. How did you find it? I could not reason a logic except by guessing and trying to disprove it.
@chrissdehaan
@chrissdehaan Жыл бұрын
@@luizalbertolausdarosa6819 It's hard to explain tile locations in text, but let's take that unflagged bomb under the 4 as a starting place. Down, down, right of that is a 2. That 2 has a flagged mine and 2 untouched tiles. Exactly 1 of those 2 must be a mine. Above that 2 is a 3. Around it there is one flagged mine, the 2 untouched tiles from before (where we know 1 of those 2 is a mine), and 3 untouched above it. So, to satisfy this 3, we need: (1) the flagged mine, (2) 1 of those 2 from before (left and right of the 3), and (3) one of the 3 untouched tiles above it. So, exactly one of the 3 untouched tiles above the 3 is a mine. The last step is to look at the 4 that is up up left of the 3. It says that one of the 2 below it must be a mine. Well, if that's the case, then it would satisfy the (3) from before. Since the 4 wouldn't be satisfied with a mine sitting to the top right of the 3, there can't be a mine there. Did that explain?
@Maric18
@Maric18 Жыл бұрын
the highlighted tiles during the explanation are pretty hard to see
@nonetrix3066
@nonetrix3066 Жыл бұрын
Someone should port this to make it a Android live wallpaper or something
@besusbb
@besusbb Жыл бұрын
I suggest you maybe try implementing this since it might be fun (might take a while though): Loop through all revealed tiles to find the numbered ones. The number on these tiles are the sum of mines of their neighbouring unopened tiles, so you can describe *all* the information of a minesweeper game in a big (augmented) matrix constructed from these sums (think of the total mine count as an opened numbered tile neighbouring every other tile). Group all the columns that are exactly similar into one since tiles representing these columns have equal probability of containing mines, creating a smaller matrix. Change the matrix into reduced row echelon form, then remove all rows with only 0s at the bottom. Now every single solution in this matrix represents a valid mine distribution within groups (i.e., describing that there's x mines within this group of cells) and the solution space is the number of rows minus number of columns of that matrix. Solve for constraints of every group (e.g., this group can only contain between x and y mines in it) using the fact that: every group must have at least 0 mines, at most, the number of tiles in that group, and using the matrix. Iterate through the solutions space (every solution is dictated by only a few "free" variables), checking if they're valid or not using the constraints. Then you can toy around more with the combinatorics to work out the number of solutions where one set tile in each equiprobable group is a mine. Assuming that every configuration of mine is equally probable to occur, you get the *exact* probability of each tile being a mine or not.
Minesweeper AI (Playing on Massive Games)
11:29
Coding Channel
Рет қаралды 15 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,4 МЛН
НЕОБЫЧНЫЙ ЛЕДЕНЕЦ
00:49
Sveta Sollar
Рет қаралды 8 МЛН
Getting Infinite In 2048 Sandbox! (Really Cool To Watch)
0:48
Alex M
Рет қаралды 1,1 МЛН
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 897 М.
Turning an Optical Illusion Into a Playable Character
22:39
ByteBlox
Рет қаралды 65 М.
The hidden beauty of the A* algorithm
19:22
polylog
Рет қаралды 817 М.
4D Minesweeper: It's Real And Will Destroy You.
21:44
Aliensrock
Рет қаралды 460 М.
Motion Canvas is now Open Source!
4:17
aarthificial
Рет қаралды 780 М.
New Minesweeper World Record - Biggest Minesweeper Ever Solved
6:15
David Amirault
Рет қаралды 777 М.
How principled coders outperform the competition
11:11
Coderized
Рет қаралды 1,5 МЛН
Bot Destroys Google Minesweeper
2:09
Cossibility
Рет қаралды 2,1 МЛН
Индуктивность и дроссель.
1:00
Hi Dev! – Электроника
Рет қаралды 1,3 МЛН
3D printed Nintendo Switch Game Carousel
0:14
Bambu Lab
Рет қаралды 3,8 МЛН
Edit My Photo change back coloured with Bast Tech
0:45
BST TECH
Рет қаралды 335 М.
Power up all cell phones.
0:17
JL FUNNY SHORTS
Рет қаралды 41 МЛН
Как я сделал домашний кинотеатр
0:41
RICARDO
Рет қаралды 1,2 МЛН