The bot detector is probably just a captcha repurposed for mine sweeper. In other words its watching your mouse movements and how fast you are clicking a tile. If your mouse moves too perfectly, or you are clicking too fast for a human, it flags your submission and you get rejected.
It might just not be storing the data at all. Like it was bugged years ago and it's just defaulting back the scores because it can't update the database.
Ok so basically Board is set up, mines are hidden. You click a space, if bomb then boom you lose. If the space has bombs nearby the space will tell you exactly how many are next to it (across and diagonal). If the space has 0 bombs nearby then the board will expose the bubble of spaces that also have 0 bombs next to them, until a shell of spaces are formed with with the edge being made of pieces next to bombs. You have the option to mark spaces you are certain bombs are on. Goal is to expose all non-bomb tiles
@MaceattacChode Bullet. His second pseudonym I believe, the one he used to try to get past the anti-bot system. Chode is also another word for big member, or someone who has a big member. I know it's not a Digby if you have to explain the joke, but imma leave this hear for the people like me who don't get jokes without the explanation.
I play a lot of dnd, I love making maps and looking at map generators, that final set of speed shots of the super big minesweeper grids gave me the idea of using the bombs and numbers to create an elevation map of mountains and valleys. Idk why that came to mind but wanted to share.
Slightly related, but I'm making a dungeon crawler based on Minesweeper. The main idea came from how Minesweeper definitely looks perfect for a procedurally generated dungeon map to my eyes as well 👀
At 10:42 - "Someone has dethroned me on beginner?" It is technically possible to get a clear of 0.0 in Beginner, though the timer will still show 01. A single click can actually clear the screen on a handful of boards.
the thing is that the possibility that someone, somewhere, got an insta win run within the 5 second frame of code bullet submitting his run before it gets deleted is just too improbable. The "unknown" user is most likely his previous runs getting shadow banned
@gorgonix13 You can easily create a custom game where this is the likely outcome. I believe there are too many bombs for the amount of space even on Intermediate for this to be possible. I'd be astonished if there is any layout where this could happen on Expert. Edit: They could just be clumped all up on one side, as astronomically improbable as that is, so it's possible on any configuration. I'm dumb.
it's 2 clicks minimum, at least in original game - you can't click on bomb with your first click and you need to open at least 1 square i've seen that personally on beginner but never 1 click win
could be when the game checks for high scores it just puts the newer one in front of the old one if they are both equal, therefore the most recent one will be at the top
It baffles me how, after so many many years, this mant can't for the love of code add a key to stop his own creation to take control over the computer.
I added IP-based bot detection to a very simple online game I made. The difference was that if your IP was banned then you would still see your score if you loaded the highscores from that IP address. This meant that any cheaters would see their name at the top of the leaderboard and then they would go away. Only legitimate scores were shown to other people. As far as I know, no cheaters ever figured this out but then it was a very small game.
@Legendendear yeah, everyone's happy, even the cheaters. Of course it doesn't work if the cheater brags to their friend about their highscore but it was good enough.
It's real easy. The numbers show how many bombs are in the 8 tiles surrounding the number. That's it. The only rule. The rest is just logic and patterns.
CB: "What's the lowest level shittiest AI you can think of?" Me: "Well, obviously it'd be one that just clicks the squares randomly." CB: "The plan is to pick a random tile... And click it." Me: *nods approvingly*
0:35 maybe that's the joke but most versions of minesweeper will not allow losing on the very first click; the game will rerun the random layout until a safe starting one is found
fun fact: that's a common misconception! the official windows version of minesweeper (the most common version to play on, and the version used in the speedrunning community) doesn't regenerate the board automatically if your first click was on a mine. rather, it simply moves the mine to the first safe spot it can find starting from the top left.
@teamworm5932the code that fills every spot with Kamil's name was probably written back when that was true, or is just a cute nod to a previous record holder.
@realdragon Basically, if there is a bomb that could be in 1 of two spots, picking the spot that is most likely to determine in which of the two spots it is.
12:37 (havent seen rest of video so i don't know if he fixed it) it would be some big brain shit for such a website but an option would be that it is iding like a component of your pc
Classic computer programmer solutions in order of choice: 1. "Simulate every possible configuration and pick the best one" 2. "Simulate every possible configuration except some bad ones and pick the best one" 3. "Simulate every possible configuration except some more bad ones and pick the best one" 4. "Simulate every possible configuration except some more bad ones (cached) and pick the best one" 5. "Simulate every possible configuration except some more bad ones (cached) (x2) and pick the best one" ... 1000. "Solve the problem analytically"
@DraykonVokelda Wouldn't it be more accurate to say that computers are way dumber than us and forcing it to use even a fraction of our analytical skills is extremely difficult?
Just a word of advice when using pyautogui. It has a built in killswitch so if you just shove your mouse into a corner it kills the program. Even if you are moving the mouse really frequently you can almost always shove the mouse into the corner before it gets moved again.
Or you know, just add an additional key kill switch. It's like a few extra lines of code and gets around the very problem seen in this video where the cursor is out of his control.
15:06 the AI getting stuck guessing a dozen times back to back here had me dying. The cursor is a nice touch and at high speed its even better. Funny imagining the AI actually just getting frustrated. Got super lucky to win so many 50/50 in a row
@livedandletdiethe best starting point is a corner. If you get something other than 0, you click another corner. Look up opening strategies if you want to learn more
@livedandletdienot quite as rare as you'd come to expect on a board of this size. even if the density is only 16%, the sheer amount of mines makes a 6 almost guaranteed to appear at _least_ once, and the probability of a 6 being an 8 is a little over 3%. wouldn't be all too surprised if one of the boards had one and we just never got to see it due to his code making finding an 8 impossible.
a human doing the giant minesweeper game is crazy. I imagine my weird uncle spending like 2 weeks working on it and then me and my cousins exit it to visit a website that plays fart sounds.
Not really, we used to play that size on the school computers, and you can get to the last few squares easily within like 20 minutes, its just that there is so much luck in actually completing it, that we've never succeded.
The board he shows appears to be 99x50/900. This is not a particularly difficult board. Would take me about an hour of attempts to beat given. I've done 100x100/2184 which is considered to be about 100 times as difficult
There's a game on mobile called Antimine which has completion detection, so it guarantees a solvable board, and I've played 100x100 / 2000 something like 15 times on it, all scores under an hour, best was ~43 minutes.
This is what gets people into programming. Not the multi-billion parameters transformers, not the life-saving prediction model only a handful of people pretend to understand. No months of "training". Just. Click. The. Screen. I love code bullet
13:41 That's likely not optimal play. If something is a 50/50 shot, you're MUCH less likely to hit a bomb if you pick another random spot on the board. (Assuming that there are still more squares than unknown bombs anyway.) So, if you get to a 50/50 situation, have it click on a square elsewhere. If it's not a bomb (which should be likely) you'll open up more of the map and get continue the program. Ideally, you'd get enough additional information to figure out if those 50/50s are actually 50/50 or if the can be solved.
Sometimes you just never can though. Like if you get this layout: F 2 2 F 2 B B 2 2 B B 2 F 2 2 F Where F is a flag and B is blank then you can never tell which to click, there's always a 50:50 of any blank being a bomb or not.
Just cause theres 2 possibilities (bomb or no bomb) doesnt mean its a 50/50 probability. There could be a 10% chance that theres a bomb and 90% chance there isnt a bomb based on all the possible scenarios where in 9 of those theres no bomb
@scragar So, firstly, I assume you mean 2s not 1s, in which case, yes, this is a true 50/50 scenario. BUT, some cases that CB didn't account for you would have a 50/50 between two squares but, clicking randomly on the far side of them would get you a 20/80 or whatnot based purely on the tile to bomb ratio. Anyway, he wasn't really looking for win percentage but speed on the ones he did win.
Don't know if anyone else has said it yet but; At the higher tiers, knowing how many bombs are left CAN be helpful for statistically determining how many are in a cluster and narrowing down the possibility space of where they can be. It's niche but it shows up in the BIG maps fairly often
I was going to comment the same thing. Adding even more complexity is that it can be mathematically more sound to, depending on the situation, select an internal tile. You must weigh the advantage of gaining new knowledge vs. selecting an easily known statistic. I'm sure there are ways to calculate the chances of either but it would be a hard problem, especially when you consider future choices and how your current actions affect your next selection.
To calculate the stats you would need to sum the average number of bombs for each stronghold on the edge. Subtract that number from the total, then divide but the new amount by the total number of internal squares to give you the percent chance of hitting a bomb inside any given stronghold. From that point if the odds favor you, you can select the tile that is most influential that is 1 tile away from any edge. An influential tile is one that has the most cleared tiles within 2 tiles of it, so like a corner piece or peninsula.
For the percentages I mentioned you would likely need to weight the percentages since the internal selection doesn't always give positive information. You could do that by using an AI to select the percentage based on the number of internal squares, edge squares, and average bomb chance for a given stronghold, you should also include the number of bombs left and total average bomb chance. This would mean that certain strongholds (even when there are multiple) can be selected for independently. If you used a simple feedback model you could likely curve match some mathematical formula reduce the space used and potentially speed things up. I wouldn just train the model and use the matrix to produce a good output.
@james_wasson I don't think you can optimize it all, right? Every configuration of bombs has an equal probability; so you have to consider every configuration that matches the revealed spaces; which would be a function of n factorial. For each bomb state, after any click we have a new bomb state and need to consider which bomb states are still possible. But to choose the best click we need to know every reveal state and the probability that the new state is solvable. So we end up needing to consider all possible click sequences across all possible bomb states. We can algorithmically prove certain choices are bad without completing the tree; but so many of them are going to be so similar I don't imagine we can ever trim it down to only a few candidates until the very end. The partially revealed edges prevent any sort of symmetry. So I think the best optimization you could achieve is a neural net trained on the possibility trees for smaller or more revealed boards? At least, I kinda think that's the case... I'm not very sure.
algo suggestion: The spots where you're most likely to have to guess are the edges and corners. Begin each game by guessing a dozen squares on the edge. Most of these games will fail, but they will fail quickly, so you will have more total games. The ones that won't fail aren't as likely to need guesses. Also in general, if there's an area where guessing is required, don't postpone it, guess immediately.
But sometimes you can guess in late game to correct answer by counting the rest of bombs. Sometimes its 1 or two in an area. If u guess immediately you have lower chance. But with 50/50 areas i agree!
I was a mine sweep feind in HS. When I got to the point where guessing was needed, you can calculate a better probability of likelihood of a bomb by counting remaining bombs and remaining possible spaces.
But does that actually help with choosing among the remaining spaces? Sure, it gives a probability overall, like let's say there are 4 spaces remaining and one of them is a bomb, OK so 25% chance overall, but if the clues don't settle it how does the bomb count settle it? I can only think of the situation where you've actually found all the bombs and should open the remaining spaces with 100% confidence, then the count being 99/99 or 40/40 or whatever would help. (Also btw fiend not "feind"...)
@VV-rk3wu sometimes endgames are possible using minecount, but in most cases you'll find either a guess scenario not in endgame so minecount doesn't help, or a true 50/50 (or stuff with worse odds, 50/50s are just the most common).
@iamjorj Ah, I think I am probably forgetting some patterns where it's possible the same clues can be solved by either 1 or 2 mines, and then maybe the count can provide a hint towards which direction has higher probability overall (fewer mines vs. more mines) and give a slight preference.
I'm Krxzy on that all time expert leaderboard and it basically flags any score on expert/intermediate all time that the guy that made the website makes sure isn't a bot or something.
There is still room for improvement. 14:24. AI is guessing but look to the left of the mouse pointer there is a 231 at the edge of the game. S and SW of the 3 only one bomb is possible because otherwise there would be 3 bombs for the number 2. So SE (below 1) must be marked. Then S is safe to click. This solves the problem without guessing. Either the search does not work correctly, or it guesses before all possibilities have been checked. I think guessing should only be started when all other possibilities on the whole map have been checked. This will generate the most information before guessing.
14:17 "There really is no way of improving the AI from here" Yes there is. 1. Firstly, you said that the AI picks the square that is safe in the most configurations. This is not actually mathematically correct. The assumption that every configuration has the same probability of occurring WOULD be correct if we didn't know the remaining bomb count, but that is not the case. If we are given the bomb count, then the likelihood of a configuration will increase or decrease based on the number of bombs in it. The numbers are not difficult to work out, but assuming a large number of undisturbed tiles and a remaining mine density of P, it turns out that a configuration having 1 more bomb multiplies its relative probability by about P/(1-P). 2. Secondly, it is incorrect to assume that always clicking the immediately safest tile will produce the highest probability of winning, since moves can affect the future board state. For example, there might be a case where there are two reasonable tiles that could be clicked. One is probably safe, but revealing it (and not dying) would not produce any information about the other tile. The other tile is less safe than the first, but it's highly likely that after clicking it, we would learn the first tile's state. In such a case, clicking the first tile would be a mistake, since we would later be forced to click the second tile anyway, so it simply introduces additional risk. Clicking the second tile instead, we would, assuming we don't die, be able to safely continue the game without ever being made to take a risk with the first tile. Such situations are not uncommon in Minesweeper. So in the end, an optimal Minesweeper engines have to inevitably implement an algorithm to calculate ahead a few moves. Yes, it is unironically like chess. Yes, skilled Minesweeper players are capable of making such calculations in their heads.
I am NOT readin allat lil bro icl ts pmo fr holy YAP (nah srsly respect for putting all this work into a RUclips COMMENT. I now know a lot more than i did previously [i knew almost nothing])
Came here for that comment. I don't even know all the Minesweeper's rules, but my experience with science and maths taught me that when someone says "it can't be improved" about some math problem then there will be another person who absolutely will improve that.
Even independent of that, if you closely look at the moves the AI makes, it clearly has some implementation mistakes somewhere since it guesses in situation it doesn't have to guess - the chance that you have to guess in the midgame is basically zero, and yet the AI does it all the time. Guessing should only be needed for unlucky early game or endgame situations.
Bro didn't beat Minesweeper… he bullied it, hacked its lunch money, changed schools, and still showed up on the leaderboard the next day with a VPN and a grudge 💀💻🔥
Hey kids! are you tired of [ROCK-DEAD] Users posting [PUTRID] Posts on YOUR comments? Well i have just the thing for you! The Extension [De-Troll RUclips - Hide Unwanted Commenters] Addon [AVAILABLE FROM FIREFOX AND CHROME(tm)] can hide those UGLY comments PERMANENTLY! All for Free, get yours today!
8:35 rant...that looks like something a team of all backends with no frontend whatsoever would have done...and considering it's a fucking competetive minesweeper page...yeaaaaa, these bois haven't seen a frontend dev, or grass in AGES!
EDIT: I'm wrong. It's not solved in one click Note that this board would always be solved in one click provided you click on one of the blank tiles (28 numbered tiles + 10 mines out of 81 total tiles gives you odds of 53.08% to hit a blank tile) Anyone wanna calculate the odds of such a board being generated? Gonna say it's somewhere upwards of one in two thousand. So odds of random clicking winning would be about 0.0025%?
I like how it's just the monkeys and typewriters scenario. Get enough random things, and majority of the time it'll fail spectacularly, but then there's that one. That one monkey that successfully randomly clicks it's way through minesweeper. That one that from completely random chance, wins. That one, that no matter how many times it fails, it doesn't give up, it tries again. It randomizes it again, fail after fail, until it works. And by god, it works. It gets #1 on the leaderboards. It's honestly inspiring, an emotionless line of code. Never give up, people. It may take 2000 attempts, but you will succeed.
i like that this solve is most optimal clicks for solve solutions revealed board showed that all the mines are near the revealed board so the bottom corner was safe area and then left with 2 areas to click and solved
Another thing you can add to the code is that if there are only 50 50 left, you let the AI choose two boxes away from the discovered land, and that will give you more info about the bombs. I’m assuming there is some maths about this, but more often than not this method does work out for me
Your browser is holding you back. Level up with Opera GX: operagx.gg/CodeBullet4
Get a browser that’s literally Google chrome with a skin
they ruined it with the ui change
they ruined the ui and caused a ton of bugs
Staying with firefox and brave. I want to keep my data thanks
@bertkamen7657 they will steal data too no?
code bullet on his way to shadow ban all operagx vpns
new speedrun
tor?
@chromiumos4114 Probably banned from the start
@chromiumos4114 Shadow ban them from the minesweeper website by getting the VPN IPs that Opera GX uses banned, since they're static per location.
@chromiumos4114 Almost all Tor Ip are already banned
What I expected: funny code man doing minesweeper fast
What I did not expect: a furious battle with an ancient bot detector
He awakened the old ones
I wonder if there's a different dev who uploads a videeo sometime, on how he coded a bot detector that keeps code bullet out.
The ancient one has awoken!
A surprise to be sure.
*loud booming Destiny Rasputin noises*
I love how his code takes over his computer almost all the time and yet he never adds a kill switch XD
What if the kill switch takes over the computer?
@UNKNOWN-u6c7i knowing code bullets coding powers its highly likely now that i think about it
What if the kill switch makes the computer a killer?@UNKNOWN-u6c7i
Hi
pyautogui, what he uses, already has a kill switch built in. It's move your mouse to the corner of the screen
The bot detector is probably just a captcha repurposed for mine sweeper. In other words its watching your mouse movements and how fast you are clicking a tile. If your mouse moves too perfectly, or you are clicking too fast for a human, it flags your submission and you get rejected.
I love the BOT DETECTION on the decade-old competitive minesweeper website
Better detection than most online games now too.
It might just not be storing the data at all. Like it was bugged years ago and it's just defaulting back the scores because it can't update the database.
@AmrRahmyLive That would be funny
tbf, the creator of the site is the co-founder of a 11 billion dollar company
@apteryx ??
Love that in less than 2 minutes it already destroyed everything
Shut
Ok so basically
Board is set up, mines are hidden.
You click a space, if bomb then boom you lose. If the space has bombs nearby the space will tell you exactly how many are next to it (across and diagonal). If the space has 0 bombs nearby then the board will expose the bubble of spaces that also have 0 bombs next to them, until a shell of spaces are formed with with the edge being made of pieces next to bombs. You have the option to mark spaces you are certain bombs are on.
Goal is to expose all non-bomb tiles
Alternate title: Chode Bullet vs Bot detection
That’s not how you spell code bullet 😭
@MegaMonkeVrI know
@MegaMonkeVr He spelled it like that in the video.
what bullet???
@MaceattacChode Bullet. His second pseudonym I believe, the one he used to try to get past the anti-bot system. Chode is also another word for big member, or someone who has a big member. I know it's not a Digby if you have to explain the joke, but imma leave this hear for the people like me who don't get jokes without the explanation.
I play a lot of dnd, I love making maps and looking at map generators, that final set of speed shots of the super big minesweeper grids gave me the idea of using the bombs and numbers to create an elevation map of mountains and valleys. Idk why that came to mind but wanted to share.
Good idea!
It came to mind because it’s fucking genius.
That's fantastic!
That's how Battletech maps work
Slightly related, but I'm making a dungeon crawler based on Minesweeper. The main idea came from how Minesweeper definitely looks perfect for a procedurally generated dungeon map to my eyes as well 👀
At 10:42 - "Someone has dethroned me on beginner?"
It is technically possible to get a clear of 0.0 in Beginner, though the timer will still show 01. A single click can actually clear the screen on a handful of boards.
the thing is that the possibility that someone, somewhere, got an insta win run within the 5 second frame of code bullet submitting his run before it gets deleted is just too improbable. The "unknown" user is most likely his previous runs getting shadow banned
Technically possible on any of the board sizes, but y'know, probability and stuff
@gorgonix13 You can easily create a custom game where this is the likely outcome. I believe there are too many bombs for the amount of space even on Intermediate for this to be possible. I'd be astonished if there is any layout where this could happen on Expert.
Edit: They could just be clumped all up on one side, as astronomically improbable as that is, so it's possible on any configuration. I'm dumb.
it's 2 clicks minimum, at least in original game - you can't click on bomb with your first click and you need to open at least 1 square
i've seen that personally on beginner but never 1 click win
could be when the game checks for high scores it just puts the newer one in front of the old one if they are both equal, therefore the most recent one will be at the top
It baffles me how, after so many many years, this mant can't for the love of code add a key to stop his own creation to take control over the computer.
Where's the fun in that?
stop key == hold power button. its already built into every program you write!
Just be happy it didn't frantically start clicking Ricardo
If it wasn’t obvious before, it should be now, Code Bullet will be the one that accidentally unleashes Skynet.
Mant😭
Evan never has a killswitch ready when the code takes over his computer, hes like a reverse doofenschmirtz
But can he recognize a platypus without its hat?
@mifdsam only if he can program a primitive AI to detect it for him
Platypus the Perry?!
That's why he has the buttons!
1:25 ol malware'd myself 1-2, love it.
“AH WHAT THE F*CK IS THA-“
I added IP-based bot detection to a very simple online game I made. The difference was that if your IP was banned then you would still see your score if you loaded the highscores from that IP address. This meant that any cheaters would see their name at the top of the leaderboard and then they would go away. Only legitimate scores were shown to other people. As far as I know, no cheaters ever figured this out but then it was a very small game.
Shadow banning but ethical
@Legendendear yeah, everyone's happy, even the cheaters. Of course it doesn't work if the cheater brags to their friend about their highscore but it was good enough.
I've seen a game where it switch hackers, cheaters and bots to a secondary server, so they play against cheaters and see the cheater leaderboard.
@ypetremann the cheaterboard, if you will
@aspzx implying cheaters have friends
I must confess that I never learned how to play minesweeper, and this video did absolutely nothing to change that
you click squares randomly roughly 3000 times
It's real easy. The numbers show how many bombs are in the 8 tiles surrounding the number. That's it. The only rule. The rest is just logic and patterns.
@Q.A.D.D. it's a terribly simple game that is oddly confusing... even when explained as clearly as you did 😂
@RhysWilliams-u3obecause no matter how much you understand, you'll always be left with a 50/50 at least 1/3 of the time
I dont see how this video didnt help, he was very clear: make a code to click randomly for about 13 thousand years
CB: "What's the lowest level shittiest AI you can think of?"
Me: "Well, obviously it'd be one that just clicks the squares randomly."
CB: "The plan is to pick a random tile... And click it."
Me: *nods approvingly*
But it can be worse... it could randomly click the screen randomly, without even aligning to the grid! 😁
A shittier one would always click the same spot. If you get lucky enough, you'll win in one click.
@DanielLCarrier That was my thought. Just click the center square and reset if not won.
@GhostGlitch. It's about a 0.002% chance. Not exact but in that range
bogo sweeper
4:33 this is so cute xd
Sure
0:35 maybe that's the joke but most versions of minesweeper will not allow losing on the very first click; the game will rerun the random layout until a safe starting one is found
Neat factoid, but I think the randomised clicker was going too fast to properly see all the clicks lol
You can
fun fact: that's a common misconception! the official windows version of minesweeper (the most common version to play on, and the version used in the speedrunning community) doesn't regenerate the board automatically if your first click was on a mine. rather, it simply moves the mine to the first safe spot it can find starting from the top left.
@Golden_Pig64woah neat
@Golden_Pig64 So logically you should assume the top left is full of bombs more often than otherwise!
The current leaderboard is hilarious:
We've been
Trying to reach
You concerning
Your vehicle's
Extended
Warranty.
NOOO
NOOO
NOOO
OH YEAH 🩸🍺
YEEES
Fun fact: Kamil Muranski name you can often see on the video is a polish player who officialy holds the minesweeper record on expert :)
JZE holds the record. Not Kamil. Hasn't been Kamil for years
It's easy to hold the top when you shadowban everyone who's better than you.
@teamworm5932the code that fills every spot with Kamil's name was probably written back when that was true, or is just a cute nod to a previous record holder.
I was wondering who was the insane person that just covered the entire leaderboard
@satagaming9144 Ah, the fortune of dedicating your formative neurogenerative years to **checks notes** Minesweeper. Cool.
12:17 mouse cursor tracking perhaps? That's how some captcha works, humans generally don't move the mouse in a straight line like a bot would
There is one more way to improve the guessing: pick the spot that generates the most information.
Nah that might need an IF statement, we can’t have that on our code bullet videos.
How does it work?
@realdragon Basically, if there is a bomb that could be in 1 of two spots, picking the spot that is most likely to determine in which of the two spots it is.
When forced to guess, it could also guess outside of the frontier if the probability of picking a bomb randomly is lower.
@Zambozoo That strategy usually leads to a 50/50 later down the line. Better to break those early...
Now imagine this advanced check is an Admin that just looks at new Highscores and booted CodeBullet every time cuz of the name
The closest to official leaderboards we have in Minesweeper, actually uses manual confirmation of all submitted times.
Can’t be, he was quite clear he was Not Code Bullet.
11:52 the tax write off is crazy
Tsukasa!?
12:37 (havent seen rest of video so i don't know if he fixed it) it would be some big brain shit for such a website but an option would be that it is iding like a component of your pc
Classic computer programmer solutions in order of choice:
1. "Simulate every possible configuration and pick the best one"
2. "Simulate every possible configuration except some bad ones and pick the best one"
3. "Simulate every possible configuration except some more bad ones and pick the best one"
4. "Simulate every possible configuration except some more bad ones (cached) and pick the best one"
5. "Simulate every possible configuration except some more bad ones (cached) (x2) and pick the best one"
...
1000. "Solve the problem analytically"
Yes
Sometimes you just gotta accept that the computer is smarter than you, and throw those smarts at the problem.
@DraykonVokelda Wouldn't it be more accurate to say that computers are way dumber than us and forcing it to use even a fraction of our analytical skills is extremely difficult?
@skeetsmcgrew3282 the way codebullet uses it, computers are really dumb, really fast.
what if a neural networked learned to beat minesweeper lol
Just a word of advice when using pyautogui. It has a built in killswitch so if you just shove your mouse into a corner it kills the program. Even if you are moving the mouse really frequently you can almost always shove the mouse into the corner before it gets moved again.
I love that feature; had to use it a few times
or you can ctrl+alt+del and move the mouse and it'll kill it because pyautogui thinks about this as a different layer that it can't see
I didn't know that
Or you know, just add an additional key kill switch. It's like a few extra lines of code and gets around the very problem seen in this video where the cursor is out of his control.
Yeah, but if you can't move your mouse to the corner because pyautogui moves it somewhere so fast, you're fucked... So I heard
15:06 the AI getting stuck guessing a dozen times back to back here had me dying. The cursor is a nice touch and at high speed its even better. Funny imagining the AI actually just getting frustrated. Got super lucky to win so many 50/50 in a row
Not 50-50s but yeah
Those are worse than 50-50 mate... and there's situations where your starting tile is just a 7 or 8... which is horrible, and rare.
@livedandletdiedepends on situatuon could be 33% or could be 66%, but still yeah got a lot of those right
@livedandletdiethe best starting point is a corner. If you get something other than 0, you click another corner. Look up opening strategies if you want to learn more
@livedandletdienot quite as rare as you'd come to expect on a board of this size. even if the density is only 16%, the sheer amount of mines makes a 6 almost guaranteed to appear at _least_ once, and the probability of a 6 being an 8 is a little over 3%. wouldn't be all too surprised if one of the boards had one and we just never got to see it due to his code making finding an 8 impossible.
I’m not gonna lie they helped him so much by having advanced bot detection because it meant he could easily do his sponsor
a human doing the giant minesweeper game is crazy. I imagine my weird uncle spending like 2 weeks working on it and then me and my cousins exit it to visit a website that plays fart sounds.
Not really, we used to play that size on the school computers, and you can get to the last few squares easily within like 20 minutes, its just that there is so much luck in actually completing it, that we've never succeded.
2 weeks??????? have you never played minesweeper?
@awesomepumpkin9507 on that site and that size you should only run into a situation that depends on luck every third or so game
The board he shows appears to be 99x50/900. This is not a particularly difficult board. Would take me about an hour of attempts to beat given. I've done 100x100/2184 which is considered to be about 100 times as difficult
There's a game on mobile called Antimine which has completion detection, so it guarantees a solvable board, and I've played 100x100 / 2000 something like 15 times on it, all scores under an hour, best was ~43 minutes.
14:58 the consecutive cussing is real LMAO
Second (or Third) AI Rage I’ve seen so far
The craziest part is that there the AI actually won! If you slow it down and stare at the top left corner, it got down to zero spaces left.
@elizabethmelville48 That's the count of flags left
This is what gets people into programming. Not the multi-billion parameters transformers, not the life-saving prediction model only a handful of people pretend to understand. No months of "training". Just. Click. The. Screen. I love code bullet
Anyone here after his guest appearance with Neurosama? I guess we know what’s he’s up to now
0:30 "hell, we don't even have any if-statements in this bad boy"
*proceeds to add an if-statement
He didnt tho
@cirowo9he did for restart
@Parciwal_Gaming You're right
Hey EvEryBody! This guy's a phoney!
you've basically invented bogo sorting for minesweeper
incredible
1:20 Evan loses control of his AI. Cracks me up every time.
12:58 AI LEVEL 4.
My god he lives
E
Real
Fr
The man who exists with a huge following but never let's us follow
It*
14:40 You know someone should make this as a screensaver
yea, i want it implemented into XScreenSaver which im using. [and yes im a linux user...]
@YTGuy2006 You still use X11?
I think there are too many static pixels but neat idea
@anotheranonhere i mean... Technically. i use LXQT which can support both X11 and Wayland.
@GebenkiI don't think modern screens have the burn in issues of older screens, so most people's screensavers are really just lock screen art
“This is probably the worst thing Germany has ever done.” Yeah you’re probably right
11:35
Worst thing Germany has done 💀💀💀
it was a few people, not the whole Germany
@ghghg123 Well it was the whole Germany that voted a fascist into power lmao
@blubaylonye, thats true
@b@blubaylonbecause Austrian Painter did much good for Germany, but then started WW2
@ghghg123 No... 💀 He was a fascist from the very beginning
i love that the first one didn't even rely on clicking randomly it autosolved the instant one cell was clicked lol
it looked like it took four clicks to me
11:36 LMAO
2:22 Sometimes, chimpanzees can write Shakespeare's one work.
10:57 Thanks, I am from Czech republic!
Edit: 11:07 I hate you now!!!
@ 11:30 Don't make me baguette this
how dare you
0:57 dude made the bogosort of minesweeper
Bogosweep
@i_have_chezburgernice
@i_have_chezburger can haz your chezborger
13:41 That's likely not optimal play. If something is a 50/50 shot, you're MUCH less likely to hit a bomb if you pick another random spot on the board. (Assuming that there are still more squares than unknown bombs anyway.) So, if you get to a 50/50 situation, have it click on a square elsewhere. If it's not a bomb (which should be likely) you'll open up more of the map and get continue the program. Ideally, you'd get enough additional information to figure out if those 50/50s are actually 50/50 or if the can be solved.
Sometimes you just never can though.
Like if you get this layout:
F 2 2 F
2 B B 2
2 B B 2
F 2 2 F
Where F is a flag and B is blank then you can never tell which to click, there's always a 50:50 of any blank being a bomb or not.
@scragaronly at the end is their point. Early or mid-game just click a random tile elsewhere. It's odds are better than 50/50
Just cause theres 2 possibilities (bomb or no bomb) doesnt mean its a 50/50 probability. There could be a 10% chance that theres a bomb and 90% chance there isnt a bomb based on all the possible scenarios where in 9 of those theres no bomb
Additionally, it also needs to consider the bomb count for optimal play.
@scragar So, firstly, I assume you mean 2s not 1s, in which case, yes, this is a true 50/50 scenario. BUT, some cases that CB didn't account for you would have a 50/50 between two squares but, clicking randomly on the far side of them would get you a 20/80 or whatnot based purely on the tile to bomb ratio.
Anyway, he wasn't really looking for win percentage but speed on the ones he did win.
"This is the worst thing Germany has ever done, I think."
I just love how nonchalant that statement was.
The Opera VPN ban evasion was the smoothest sponsor placement I've ever seen
At (11:42) "This is the worst thing Germany has ever done" 💀
Why is no-one talking about this 😭
@RegularDan1 because we don’t mention the wa…bot detection.
@backupplan6058 There is no bot detection in Ba Sing Se
@RegularDan1 Because everyone else got the joke.
Yeah bro ww2 is a baby compared to this
4:08 Didn't expect a surprise Code Bullet's face reveal
Please never do that again
._.
This is what ai should be used for
Don't know if anyone else has said it yet but;
At the higher tiers, knowing how many bombs are left CAN be helpful for statistically determining how many are in a cluster and narrowing down the possibility space of where they can be. It's niche but it shows up in the BIG maps fairly often
I was going to comment the same thing.
Adding even more complexity is that it can be mathematically more sound to, depending on the situation, select an internal tile. You must weigh the advantage of gaining new knowledge vs. selecting an easily known statistic.
I'm sure there are ways to calculate the chances of either but it would be a hard problem, especially when you consider future choices and how your current actions affect your next selection.
To calculate the stats you would need to sum the average number of bombs for each stronghold on the edge. Subtract that number from the total, then divide but the new amount by the total number of internal squares to give you the percent chance of hitting a bomb inside any given stronghold.
From that point if the odds favor you, you can select the tile that is most influential that is 1 tile away from any edge. An influential tile is one that has the most cleared tiles within 2 tiles of it, so like a corner piece or peninsula.
For the percentages I mentioned you would likely need to weight the percentages since the internal selection doesn't always give positive information. You could do that by using an AI to select the percentage based on the number of internal squares, edge squares, and average bomb chance for a given stronghold, you should also include the number of bombs left and total average bomb chance. This would mean that certain strongholds (even when there are multiple) can be selected for independently.
If you used a simple feedback model you could likely curve match some mathematical formula reduce the space used and potentially speed things up. I wouldn just train the model and use the matrix to produce a good output.
@james_wasson I don't think you can optimize it all, right? Every configuration of bombs has an equal probability; so you have to consider every configuration that matches the revealed spaces; which would be a function of n factorial. For each bomb state, after any click we have a new bomb state and need to consider which bomb states are still possible. But to choose the best click we need to know every reveal state and the probability that the new state is solvable. So we end up needing to consider all possible click sequences across all possible bomb states. We can algorithmically prove certain choices are bad without completing the tree; but so many of them are going to be so similar I don't imagine we can ever trim it down to only a few candidates until the very end. The partially revealed edges prevent any sort of symmetry. So I think the best optimization you could achieve is a neural net trained on the possibility trees for smaller or more revealed boards?
At least, I kinda think that's the case... I'm not very sure.
algo suggestion: The spots where you're most likely to have to guess are the edges and corners. Begin each game by guessing a dozen squares on the edge. Most of these games will fail, but they will fail quickly, so you will have more total games. The ones that won't fail aren't as likely to need guesses.
Also in general, if there's an area where guessing is required, don't postpone it, guess immediately.
But sometimes you can guess in late game to correct answer by counting the rest of bombs. Sometimes its 1 or two in an area. If u guess immediately you have lower chance. But with 50/50 areas i agree!
YES i KNEW that i saw "Not Code Bullet" in the leaderboards and that it was code bullet, and the video is finally here!11!1!1!1!
3:00 1 in 1,878,392,407,320
AI codebullet has gotten so advanced, its almost as if he's still here with us. Fly high Evan 🕊
Please upload a 10 hour video of minesweeper automatic solving animation screen saver / destroyer for everyone's delight. Thank you 😂 14:38
This is not sped up lmao
@ErenCubesOG14:24 „10x speed“. Nothing else to add.
Love this. The concept, the dancing, the montages, the emitting, the failing to add a kill switch every time. 10/10.
we got the same name lmao
10:46 As a Croat, you should indeed believe in us,
I was a mine sweep feind in HS. When I got to the point where guessing was needed, you can calculate a better probability of likelihood of a bomb by counting remaining bombs and remaining possible spaces.
But does that actually help with choosing among the remaining spaces? Sure, it gives a probability overall, like let's say there are 4 spaces remaining and one of them is a bomb, OK so 25% chance overall, but if the clues don't settle it how does the bomb count settle it? I can only think of the situation where you've actually found all the bombs and should open the remaining spaces with 100% confidence, then the count being 99/99 or 40/40 or whatever would help. (Also btw fiend not "feind"...)
@VV-rk3wu sometimes endgames are possible using minecount, but in most cases you'll find either a guess scenario not in endgame so minecount doesn't help, or a true 50/50 (or stuff with worse odds, 50/50s are just the most common).
@iamjorj Ah, I think I am probably forgetting some patterns where it's possible the same clues can be solved by either 1 or 2 mines, and then maybe the count can provide a hint towards which direction has higher probability overall (fewer mines vs. more mines) and give a slight preference.
I'm Krxzy on that all time expert leaderboard and it basically flags any score on expert/intermediate all time that the guy that made the website makes sure isn't a bot or something.
"Finland! I choose you!" Bro was sending it out into battle against a charmander or something 😭🙏
finland mentioned 🗣️🔥
true tho
I was hoping he would save the follow up "I'm finished with you" for Finland as well. For the punny.
>"bro"
>use of crying and praying emojis
Zoom on, zoomer
Congratulations on finding the joke
Fr fr lil bro no cap ong
50% actual ai stuff 50% battle for the score
Now all that's left is to put the AI into a robot and let it lose in Cambodia
It took me a while to understand the joke 🤣
Bosnian minesweeper: flag flag flag flag flag flag flag 8 flag flag flag flag flag flag flsg flag flag
4:44 okay that was a surprise I was not expecting
It's like watching a computer defrag back in the day. Very satisfying.
11:05 as a Czech Republic Resident, im just saying: grrrrrr😡
Yea what is wrong with you😢
There is still room for improvement. 14:24. AI is guessing but look to the left of the mouse pointer there is a 231 at the edge of the game.
S and SW of the 3 only one bomb is possible because otherwise there would be 3 bombs for the number 2.
So SE (below 1) must be marked. Then S is safe to click. This solves the problem without guessing.
Either the search does not work correctly, or it guesses before all possibilities have been checked.
I think guessing should only be started when all other possibilities on the whole map have been checked. This will generate the most information before guessing.
Reading the captions at 14:00: **WHAT**
1:13 I'm old enough to remember when using the wrong GOTO command in BASIC would require a hard reset. 😄
Boomer vibes
And then I am pretty sure you would have to type the whole program in all over again
"This is the worst thing Germany has ever done I think" 💀
14:17 "There really is no way of improving the AI from here"
Yes there is.
1. Firstly, you said that the AI picks the square that is safe in the most configurations. This is not actually mathematically correct. The assumption that every configuration has the same probability of occurring WOULD be correct if we didn't know the remaining bomb count, but that is not the case. If we are given the bomb count, then the likelihood of a configuration will increase or decrease based on the number of bombs in it. The numbers are not difficult to work out, but assuming a large number of undisturbed tiles and a remaining mine density of P, it turns out that a configuration having 1 more bomb multiplies its relative probability by about P/(1-P).
2. Secondly, it is incorrect to assume that always clicking the immediately safest tile will produce the highest probability of winning, since moves can affect the future board state. For example, there might be a case where there are two reasonable tiles that could be clicked. One is probably safe, but revealing it (and not dying) would not produce any information about the other tile. The other tile is less safe than the first, but it's highly likely that after clicking it, we would learn the first tile's state. In such a case, clicking the first tile would be a mistake, since we would later be forced to click the second tile anyway, so it simply introduces additional risk. Clicking the second tile instead, we would, assuming we don't die, be able to safely continue the game without ever being made to take a risk with the first tile. Such situations are not uncommon in Minesweeper.
So in the end, an optimal Minesweeper engines have to inevitably implement an algorithm to calculate ahead a few moves. Yes, it is unironically like chess. Yes, skilled Minesweeper players are capable of making such calculations in their heads.
I am NOT readin allat lil bro icl ts pmo fr holy YAP
(nah srsly respect for putting all this work into a RUclips COMMENT. I now know a lot more than i did previously [i knew almost nothing])
@Drag0nmaster Bro your comment is pure gen-z brainrot. lol
Came here for that comment. I don't even know all the Minesweeper's rules, but my experience with science and maths taught me that when someone says "it can't be improved" about some math problem then there will be another person who absolutely will improve that.
This guys maths!
But at Code Bullet we don't do that, so I'm gonna pretend you don't exist
Even independent of that, if you closely look at the moves the AI makes, it clearly has some implementation mistakes somewhere since it guesses in situation it doesn't have to guess - the chance that you have to guess in the midgame is basically zero, and yet the AI does it all the time. Guessing should only be needed for unlucky early game or endgame situations.
Bro didn't beat Minesweeper… he bullied it, hacked its lunch money, changed schools, and still showed up on the leaderboard the next day with a VPN and a grudge 💀💻🔥
Yhea 😅
Never comment again, zoomer.
Learn peoples fucking names bro
Hey kids! are you tired of [ROCK-DEAD] Users posting [PUTRID] Posts on YOUR comments? Well i have just the thing for you! The Extension [De-Troll RUclips - Hide Unwanted Commenters] Addon [AVAILABLE FROM FIREFOX AND CHROME(tm)] can hide those UGLY comments PERMANENTLY! All for Free, get yours today!
@Djellowmanzoom in?
9:00 This is, and I'm not joking here, the single greatest ad read I have ever heard
The only acceptable ad length
Take notes, corpos
I actually love how it’s algorithmic and not reinforcement learning
2:48 Kamil Muranski's killing it bro 💀🔥
😂😂
11:04 Thanks👍
Díky moc 🚡🚡
@michaelkroutil980Díky moc😉
A já mu věřil že má rád Česko
@Lusor_CZ Ja taky
💔💔💔 a my mu věřili
8:35 rant...that looks like something a team of all backends with no frontend whatsoever would have done...and considering it's a fucking competetive minesweeper page...yeaaaaa, these bois haven't seen a frontend dev, or grass in AGES!
0:33 beating minesweeper with bogosort
Dude! Please release a 1 hour video of that giant solver at the end. I need that
13:09 bro created gojo satoru
13:24 harsh mode enabled
13:15 3rd place beginner name, rest in peace hax$ 😭
11:45 "I think this is the worst thing Germany has ever done." EXCUSE ME WHAT?! 🤣🤣🤣🤣
Underrated statement
true story
It’s up there with lederhosen and sauerkraut.
There might be that other thing that was slightly worse, idk
Someone is a student of history
13:35 Watching at 2x, I never expected "minesweeper AI with frantic Australian" to be that zen :D
Cappybara is the most australian non australian animal I can think of
You could make the algorithm much faster if you don't actually "flag" a bomb, cause that takes time to click; just update that info in the memory.
0:40 this is literally how you get a tie with the world record for the smallest map on the original windows version of minesweeper lol
0:45 Statistically, it's better than BOGO sort.
Edit 2:26 see?
E
EDIT: I'm wrong. It's not solved in one click
Note that this board would always be solved in one click provided you click on one of the blank tiles (28 numbered tiles + 10 mines out of 81 total tiles gives you odds of 53.08% to hit a blank tile)
Anyone wanna calculate the odds of such a board being generated? Gonna say it's somewhere upwards of one in two thousand.
So odds of random clicking winning would be about 0.0025%?
I like how it's just the monkeys and typewriters scenario. Get enough random things, and majority of the time it'll fail spectacularly, but then there's that one. That one monkey that successfully randomly clicks it's way through minesweeper. That one that from completely random chance, wins. That one, that no matter how many times it fails, it doesn't give up, it tries again. It randomizes it again, fail after fail, until it works. And by god, it works. It gets #1 on the leaderboards.
It's honestly inspiring, an emotionless line of code. Never give up, people. It may take 2000 attempts, but you will succeed.
@photoo848 I don't have definitive proof of this, but I'm pretty sure whatever algorithm they use to plant the bombs disallows this.
i like that this solve is most optimal clicks for solve solutions
revealed board showed that all the mines are near the revealed board so the bottom corner was safe area
and then left with 2 areas to click and solved
5:13 How HOW many places left???
27 MENTIONED LET'S GOOOOOO
We gotta arrest the person putting mines everywhere its getting ridiculous
@1:13 Aaaaand 1 minute into a Minesweeper video, Code Bullet manages to create Skynet and begin the AI revolution... it cannot be stopped now.
CB: "i just want a screenshot of me on top of all of the leaderboards"
me: clicks 'inspect element'
As a Game Developer, this is pure Horror and Graphic violence. Literally a nightmare. Good work.....
i cry a tear of joy whenever code bullet uploads
i cry I pray Mon dieu
a white tear slipped down my leg 🧐
@crackuheadu633 is that a jojo reference?
I love how the term AI has now strayed so far from its original definition, that its used for plain old computing xD
IIRC the term AI has been used for algorithms that play games since before machine learning was a thing
@OntarioTrafficMan Fair point. In a gaming context the term _AI_ really means _algorithmic intelligence_ most of the time.
I’ve got a feeling Kamil just sits there seething, banning anyone who beats her he’s score…
use "their" instead of "she he" its more convenient
@taureon_ cheeseburger master 123
@taureon_ Literally nobody asked.
Shut up @InsanityReborn
@taureon_ Your brainrot has no power here silly.
Another thing you can add to the code is that if there are only 50 50 left, you let the AI choose two boxes away from the discovered land, and that will give you more info about the bombs. I’m assuming there is some maths about this, but more often than not this method does work out for me