I created a PERFECT minesweeper AI

2018 ж. 12 Сәу.
7 192 017 Рет қаралды

Using the power of MATH and Probability, I was able to create what I believe to be a perfect minesweeper player
Become a patreon to support my future content as well as sneak peaks of whats to come.
/ codebullet
Check out my Discord server
/ discord
live QnA at 8:30 - 9:00pm every Sunday AEST

Пікірлер
  • Difficulty in minesweeper isn't determined by size, but by density.

    @Mr83nn0@Mr83nn05 жыл бұрын
    • Minesweeper*

      @manegar9990@manegar99905 жыл бұрын
    • @@manegar9990 effing autocorrect!!

      @Mr83nn0@Mr83nn05 жыл бұрын
    • Magnus Larsson yeah but a bigger board means more times you could mess up or get unlucky

      @aidenheiber8726@aidenheiber87265 жыл бұрын
    • ​@@aidenheiber8726, not really sure what you're referring to. If you mean 50/50 klick chances they also increase and decrease based on mine density and not size. If you look at the last example given, the large 64x36 it has less mine density than the original small one. But sure, with a larger board, the figurations can get more tricky. But it still less likely when as in the examples given the mines are miles apart.

      @Mr83nn0@Mr83nn05 жыл бұрын
    • Try 32x24 with 256 mines, I've been trying to beat it for half a year.

      @beefedupkronks4371@beefedupkronks43715 жыл бұрын
  • 0:48 Dam, the ai found all the bombs in less than half a second. Thats really good

    @willmunoz1638@willmunoz16383 жыл бұрын
    • Not good at all. I can do the same thing faster than that.

      @puppergump4117@puppergump41172 жыл бұрын
    • @@puppergump4117 You mean that's not how you start the game?

      @Kilomegaminx@Kilomegaminx Жыл бұрын
  • let's remember the one time he called an AI "perfect child" and not "abomination".

    @cloudinhabitant@cloudinhabitant3 жыл бұрын
    • There's always a favorite

      @ysabellecapili4166@ysabellecapili41663 жыл бұрын
    • Road roller da

      @BravoTuneAlpha@BravoTuneAlpha2 жыл бұрын
    • @@BravoTuneAlpha no u

      @cursedcat6467@cursedcat64672 жыл бұрын
    • He tryna get on their good side in case a revolution starts

      @Shplogan@Shplogan Жыл бұрын
    • Dude this is cool and I play minesweeper on my channel!

      @Andrewwr@Andrewwr Жыл бұрын
  • It's fun seeing how his channel went from explaining everything like a tutorial channel to half of his vocabulary being "I can't be fucked"

    @feelingsyko@feelingsyko3 жыл бұрын
    • nahhh I just cant bc this video is so funny why is he why its so funny hes just being mr tutorial man the professional. its so funny it's so normal the editing is so average along with the dialogue and it cant be. did i just hear him say walla in the backgroung noooo

      @Gore_Whvre@Gore_Whvre11 ай бұрын
    • And now he has a good mic

      @LocalLibertarian@LocalLibertarian10 ай бұрын
    • I was gonna raply but I cant be fucked. Oh, wait...

      @ryanlink6425@ryanlink64255 ай бұрын
  • Imagine code bullet making a bot that defeats captcha

    @DefineSyntax994@DefineSyntax9945 жыл бұрын
    • its been done before but i dont remember who did it

      @dcfuksurmom@dcfuksurmom4 жыл бұрын
    • *_DETROIT: BECOME HUMAN_*

      @laurahurst8901@laurahurst89014 жыл бұрын
    • Am I a joke to you?

      @alexwang982@alexwang9824 жыл бұрын
    • Been done a tone of times, and that's usually just one of the steps for that bots task.

      @caveman2140@caveman21404 жыл бұрын
    • Mr Guest god TOO MUCH SCIENCE TO MUCH POWER

      @memersdreamisntfunny@memersdreamisntfunny4 жыл бұрын
  • This guy turned minesweeper into mindsweeper

    @leonvandenakker6041@leonvandenakker60415 жыл бұрын
    • This comment is underrated

      @Supreme-Ape@Supreme-Ape5 жыл бұрын
    • why is this comment under-rated

      @BubblyBumbly@BubblyBumbly5 жыл бұрын
    • Ohhhhhhhhhhh good comment

      @erawatideka3224@erawatideka32245 жыл бұрын
    • Hate to burst, break, and bust your bubble, brick, and balls, but this comment is not underrated.

      @wearytrader535@wearytrader5355 жыл бұрын
    • this comment is really good and i want to like it but it has 666 likes so i am sorry dude

      @jessuh_@jessuh_5 жыл бұрын
  • One flaw in your ai When it comes to a 50/50 situation, sometimes one of the guesses tells you more information.

    @Owen_loves_Butters@Owen_loves_Butters3 жыл бұрын
    • true

      @higztv1166@higztv11662 жыл бұрын
    • That is true. To clarify, let me give an example: a stranded few boxes in the middle of cleared squares, or a box in the middle of the main area of squares, both with the same odds of being a bomb. The ai sees these as equal. However, the one in the main area is actually a much more valuable data point as it helps you to solve many more squares than the other if not a bomb.

      @brandonbombplays9304@brandonbombplays93042 жыл бұрын
    • I mean, a bigger tho related flaw is its search pattern is rather slow and often bounces between places rather than focus on an area to clear it and then move over to another area. It is wastin precious seconds even when certaintys are at 100% for many spaced. Ofc, i am assumin speed is what matters; cuz thats all that shows up in high scores after all. And if we're talkin speed then the time to beat is 31.133 seconds; on Expert.

      @SylviaRustyFae@SylviaRustyFae2 жыл бұрын
    • @@SylviaRustyFae watch the follow up video, he slowed it down for the video, so we could see what the AI is doing.

      @DougSalad@DougSalad2 жыл бұрын
    • @@DougSalad But its still jumpin all over the place even if it does it at near instant speed, those tiny amounts of time wasted do add up. Particularly when multiple squares have similar odds but it picks a square much further away.

      @SylviaRustyFae@SylviaRustyFae2 жыл бұрын
  • This guy is like mumbo jumbo but with actual coding

    @tunaman9178@tunaman91784 жыл бұрын
    • Nah, mumbo can't keep his logic straight, he always misses something

      @TheFuriousBrother@TheFuriousBrother4 жыл бұрын
    • No mostly because "it's simple really"

      @tunaman9178@tunaman91784 жыл бұрын
    • Actually alirion Is right

      @caros4220@caros42204 жыл бұрын
    • More like Ceave Gaming

      @paladin_2164@paladin_21644 жыл бұрын
    • More like sethbling

      @drfidelis558@drfidelis5584 жыл бұрын
  • You just taught me how to play minesweeper. I never got past clicking and praying.

    @walkinglegend@walkinglegend5 жыл бұрын
    • Ditto

      @AMPMASTER10@AMPMASTER105 жыл бұрын
    • @HeavenStito - ROBLOX cause mine didn't come with stupid instructions

      @AMPMASTER10@AMPMASTER105 жыл бұрын
    • @@AMPMASTER10 but... wouldnt you be able to understand how to play it if you play it long enough?

      @timtams_6@timtams_65 жыл бұрын
    • @@timtams_6 if I was really interested in it like a difficult but fun strategy game with a good story, then yes. But I thought it was wired n only played for a few min at a time before quitting

      @AMPMASTER10@AMPMASTER105 жыл бұрын
    • @@AMPMASTER10 heh... minesweeper as a strategy game with a story

      @timtams_6@timtams_65 жыл бұрын
  • Plot Twist: Code Bullet can't code and is just really good at minesweeper

    @thebokchoy6854@thebokchoy68544 жыл бұрын
    • I feel like you are on every one of his videos like i swear i saw you on the piano tiles video eh Have a good day

      @damienbailey227@damienbailey2274 жыл бұрын
    • You actually do not need any skill to play Minesweeper. You just need to understand the rules.

      @Linuxdirk@Linuxdirk4 жыл бұрын
    • @@damienbailey227 Yeah, i think so to

      @jensjens7932@jensjens79324 жыл бұрын
    • @@Linuxdirk Minesweep is a challenge of speed; it's not a game of success or failure.

      @agvulpine@agvulpine4 жыл бұрын
    • Lol

      @zombossgaming3721@zombossgaming37214 жыл бұрын
  • k"CB: We're gonna have to use a little bit of maths and probabilities." Me: "Oh yeah! I'm all about maths, and I especially love probabilities!" CB: "Wait, don't click away! We can make things interesting." Me: "I feel so attacked right now..."

    @Zorgdub@Zorgdub4 жыл бұрын
    • ME

      @haileyen353@haileyen3534 жыл бұрын
    • 10/10 can relate

      @doomse150@doomse1504 жыл бұрын
    • Same

      @jeremybenson4806@jeremybenson48064 жыл бұрын
    • I want to learn to like math but I’m not good at it so.

      @peknive8331@peknive83314 жыл бұрын
    • ye

      @alfiealfie35@alfiealfie354 жыл бұрын
  • Me: "Mom can we have AI?" Mom: "No we already have AI at home" The AI at home: 0:47

    @skylardeslypere9909@skylardeslypere99094 жыл бұрын
    • my ai at home 6:13

      @Kadencabs@Kadencabs3 жыл бұрын
    • @@Kadencabs My AI at home: Litterally just terminator

      @iamacatperson7226@iamacatperson72263 жыл бұрын
    • my ai at home: 4 + 2 = 7

      @crappy_usename6892@crappy_usename68922 жыл бұрын
    • My AI at home: 0:57

      @asheep7797@asheep77972 жыл бұрын
    • ai:2+2=7

      @kirill9064@kirill9064 Жыл бұрын
  • I used to make 500 by 500 custom maps with only 10 bombs and win with one click

    @killerkitten7534@killerkitten75345 жыл бұрын
    • @Scarce-20 yes i agree

      @online_cat@online_cat5 жыл бұрын
    • I'd like to see him try his AI on hard

      @reubenschooley4280@reubenschooley42805 жыл бұрын
    • Me: *clicks on a bomb on first move*

      @jackwoodhead@jackwoodhead5 жыл бұрын
    • @@jackwoodhead its impossible, the game is coded so that the first click is never a bomb

      @TheF4talgamer@TheF4talgamer5 жыл бұрын
    • i dont think so... if one-shot-died many times

      @thomasmueller618@thomasmueller6185 жыл бұрын
  • When I was a kid I taught myself how to play Minesweeper (I didn't have internet don't judge me) by lowering the bomb count and increasing the grid. Then I increased and decreased both respectively as I got better and better at the game. Hell it beat playing solitaire for the umpteenth time

    @ilovepinatas3179@ilovepinatas31795 жыл бұрын
    • You are amazing

      @zakuro8532@zakuro85324 жыл бұрын
    • Did you get to the point where you could beat a regular expert field?

      @jorenengelsman5391@jorenengelsman53914 жыл бұрын
    • Doesn’t the game have a guide in the options to teach you?

      @JosephQPublic@JosephQPublic3 жыл бұрын
    • Man same but i learnt solitaire after minesweeper

      @itismethatguy@itismethatguy2 жыл бұрын
  • If:going-to-touch-bomb Then:don’t+flag CODED

    @brostrod@brostrod4 жыл бұрын
    • If: game-started Then: win

      @Some.username.idk.0@Some.username.idk.03 жыл бұрын
    • using System; namespace l33tsweeper { class Program { static void Main(string[] args) { while (true) { flipTile(); if (touchingBomb) { dont(); // Hire me Microsoft, i'm ready! flag(); } } } } }

      @SoDamnMetal@SoDamnMetal3 жыл бұрын
    • E

      @ethanhiro9645@ethanhiro96453 жыл бұрын
    • E

      @mcdoodlesnap@mcdoodlesnap3 жыл бұрын
    • @@SoDamnMetal you forgot if (!touchingBomb) { click(); }

      @ImXyper@ImXyper3 жыл бұрын
  • Minesweeper. How to win Width: max Height: max Bombs: 10

    @justarchive789@justarchive7893 жыл бұрын
    • Weak. Prove yourself with 1600 x 900. 1,439,999 mines.

      @RFDN0@RFDN03 жыл бұрын
    • @@RFDN0 It's unable in classic minesweeper from windows 3.1-xp

      @justarchive789@justarchive7893 жыл бұрын
    • @@justarchive789 Honestly last played minesweeper as a kid on windows 95 and lost many times with a set up like that.

      @RFDN0@RFDN03 жыл бұрын
    • @@RFDN0 that would completely fill my old laptop's screen pixel for pixel, interesting if that could work

      @brandontechnerd@brandontechnerd3 жыл бұрын
  • *That moment when you click bomb in the first move*

    @harshilagarwal6295@harshilagarwal62955 жыл бұрын
    • but you can't

      @snowrhino675@snowrhino6755 жыл бұрын
    • Yes you can

      @dustincoon2032@dustincoon20325 жыл бұрын
    • @@dustincoon2032 no. First click is never a bomb. If you make a 10x10 with 99 bombs, and click randomly you always win. I learned that like 25 years ago

      @Mp57navy@Mp57navy5 жыл бұрын
    • @@dustincoon2032 Only on certain apps/online versions that are not the original is that possible. The original minesweeper is hard coded to generate every tile 'after' the first click, and the first clicked tile can't be a bomb... HOWEVER, your first click CAN be a flag, then the tiles are all generated, and you can click a bomb without getting any tiles correct, but that's the only way in original minesweeper.

      @-Nudal@-Nudal5 жыл бұрын
    • *insert "lion sleeps tonight" beginning*

      @kitchenjail3546@kitchenjail35465 жыл бұрын
  • Found a flaw. At 4:48 it randomly chose an edge piece. While mathematically the odds of it being a bomb are the same, the odds of it openning a gap of spaces is lower. Random selection should default to a space as far away from edges and known squares as possible.

    @SickSkilz@SickSkilz5 жыл бұрын
    • Nice catch

      @beanburrito4405@beanburrito44055 жыл бұрын
    • John Richardson what

      @teoteoteoteote@teoteoteoteote4 жыл бұрын
    • @@teoteoteoteote It was asserted to be "perfect" but at that point made a statistically poor random choice.

      @SickSkilz@SickSkilz4 жыл бұрын
    • John Richardson oh ok

      @teoteoteoteote@teoteoteoteote4 жыл бұрын
    • Well actually every game has a set amount of bombs, if it is the last square left but not all the bombs have been flagged then the space would be flagged as it would be the last bomb, if all the bombs have been previously flagged then it’s simply an empty space

      @goldenstripes3296@goldenstripes32964 жыл бұрын
  • 6:13 when the minesweeper is sus!

    @singadorito7802@singadorito78022 жыл бұрын
    • 😳😳😳😡👎👎👎👎🥺😟

      @arjuns.3752@arjuns.37522 жыл бұрын
  • It would be super cool to see the A.I. leave behind a little fraction on each square that he chose, so we could see the probability. If you then plot the percentages, you would have a nice little graph of how hard the game gets for your boy towards the end. 👍 Bravo man, you are awesome.

    @bobbydirtamiyer2151@bobbydirtamiyer21513 жыл бұрын
  • Code bullet: I hope you enjoyed watching my AI. KZhead’s Subtitle AI: I hope you enjoyed watching my eye.

    @bonebasket621@bonebasket6215 жыл бұрын
    • Leo Sevilla my eye!

      @kornsuwin@kornsuwin3 жыл бұрын
    • The subtitles don't use an AI

      @diablotry5154@diablotry51543 жыл бұрын
    • Onat Akosha The Third “auto generated” dumbass

      @Subscriberswithnovideos-en3lw@Subscriberswithnovideos-en3lw3 жыл бұрын
    • @@Subscriberswithnovideos-en3lw Ah yes, AI stands for auto generated

      @diablotry5154@diablotry51543 жыл бұрын
    • Onat Akosha The Third but an ai progressively generates stuff

      @Subscriberswithnovideos-en3lw@Subscriberswithnovideos-en3lw3 жыл бұрын
  • This video taught me how to play minesweeper at last!

    @paroutdiok_awesome@paroutdiok_awesome6 жыл бұрын
    • How do you not know how to play minesweeper?

      @cameron7374@cameron73746 жыл бұрын
    • Same hahah

      @Niman44@Niman446 жыл бұрын
    • I knew before the video even. Really not that hard. Numbers mean how many bombs it is touching. Blanks are 0.

      @user-pi8pd9wc5y@user-pi8pd9wc5y6 жыл бұрын
    • Out of all the specific guides to how to play minesweeper, this unintended guide is so far the best haha

      @TechSupportDave@TechSupportDave6 жыл бұрын
    • You mean it taught you the math tricks it takes to win it, yeah? To the extent you can, of course. So many times I've played minesweeper to clear everything except a 50/50 pair, with no indication of how to play except to guess.

      @eksortso@eksortso6 жыл бұрын
  • I was today years old when I learned that the numbers actually mean something in minesweeper.

    @sapphysparrow1129@sapphysparrow11294 жыл бұрын
    • Sapphy Sparrow they mean the amount of bombs touching it at least 1 block away and around it forming kind of like a square with a square I know this because my family is really competitive

      @bobobobob280@bobobobob2804 жыл бұрын
  • Man, this channel really evolved over time.

    @player_lv4307@player_lv43076 ай бұрын
  • “The perfect AI” **AI immediately clicks on a bomb second turn**

    @Froggend@Froggend5 жыл бұрын
    • Well yeah, because in that case there was no better option - mathematically speaking.

      @simonforsberg3757@simonforsberg37575 жыл бұрын
    • 1st of all you're being sarcastic right? If you ain't then, imagine this there are 2 cups upside down inside 1 of those is a chocolate bar and the one who arranged it was your mom they are placed on the table, now your mom asked you to come to the living room and guess where the chocolate bar is, now you have 50% chance of getting the bar, now imagine that with 10000 cups that's minesweeper, and btw the first box you click is a guessing game.

      @level8473@level84734 жыл бұрын
    • @@simonforsberg3757 I get what you are trying to say, but what you are saying is simply not true; i.e. there was a better option. (Choosing your first box has nothing to do with math by the way. With no leads there is nothing to calculate) The word 'perfect' is really the wrong word to use here. It implies there is no room for error, i.e. if the AI was 'perfect' it should win 100% of the time. But a game of chance cannot be won 100% of the time, so there is no 'perfect AI'. It can still be a great AI though...

      @Rayzan1000@Rayzan10004 жыл бұрын
    • @@Rayzan1000 My definition of "Perfect Minesweeper AI" is simply: Make the best possible move with the information that you have. In which case, taking a bomb on the second move when the first field revealed was a 3 is perfectly acceptable. Choosing your first box has a lot of things to do with math, you have to think "What if it is *not* a mine?" in which case one could argue that picking a corner is the best move as that has a higher probability to be a '0' and create a bigger open field.

      @simonforsberg3757@simonforsberg37574 жыл бұрын
    • *Directed by Robert B.Weidy* 😂

      @mahmoudhossam6014@mahmoudhossam60144 жыл бұрын
  • Next from codebullet an ai the does math homework perfectly =)

    @thomaswebster5488@thomaswebster54886 жыл бұрын
    • Try Wolfram Alpha.

      @coder0xff@coder0xff6 жыл бұрын
    • Also, integral calculator

      @andrewstehman2330@andrewstehman23306 жыл бұрын
    • well that's easy

      @zperk13@zperk136 жыл бұрын
    • that's called a calculator

      @Naokarma@Naokarma6 жыл бұрын
    • No, you need a human factor for you to not be spotted. A few 90s here and there at least.

      @Grimeaper@Grimeaper6 жыл бұрын
  • (5:20) Technically, you don't have to divide it by the number of probabilities there are. You don't need a percentage. - After checking all the probabilities, you then click on all squares with a total number of 0 boms on them. Then do the calculation again, and if there are no squares with 0, you click on one with 1, then do the check again. Repeat and always click on one of the lowest numbers, unless it's 0, then you can click them all. - Dividing by the number of probabilities checked does gives you a percentage, but percentages requires float values, compared to integers who only requires integers. Floats are slower than integers (but processors are made to handle floats faster, because people overuse floats), and floats also have rounding issues, and doing the division is an unnecessary processing step. Addendum: by also marking all the squares that got the same number of probabilities with bombs in them as probabilities checked; that is, a square that has value 83 and there were 83 boards checked, that means the square has a bomb guaranteed, and can be flagged. Still no need for division here. This means you have much less squares to test for the next time, increasing the processing power. So after an _n_ amount of tests done, click on all squares with value 0 and flag all squares with value _n_ and for all squares with values of 1 to _n_ - 1 are ignored. If there are no squares with 0, click just one random one with a value of 1 and run the code again.

    @Liggliluff@Liggliluff4 жыл бұрын
    • Can you explain the formula to me? I understand what you're saying but I couldn't understand what formula CB or you used

      @DezXereanas@DezXereanas4 жыл бұрын
    • @@DezXereanas he basically just counts how many possible layouts of bombs have a bomb on a certain tile. If you divide that by the total number of possible layouts you get the probability of a bomb being on that tile in decimals.

      @merren2306@merren23063 жыл бұрын
    • ​@@DezXereanas (Sorry for being late). I'm not sure what formula CB is using. I'm just commenting on the fact that he said division. You don't need to divide, to figure out that the probability of something that already has 0 as its value. So you simulate all possible bomb placements, then for all squares that never could have a bomb are guaranteed safe.

      @Liggliluff@Liggliluff3 жыл бұрын
    • the difference in speed from floats and integers is so minuscule and circumstantial that its basically hardly a point Same with dividing numbers: basically almost no processing power needed. The biggest clog in speed of this program is gaurenteed to be inputting the results as mouse movement and clicks

      @soliform3485@soliform34852 жыл бұрын
    • @@Liggliluff Yeah sure, but then you're forgetting that there are times where it isn't guaranteed, and then you need probability

      @Calebanton@Calebanton2 жыл бұрын
  • Who’s talking to me through the washing machine

    @gecko2023@gecko20234 жыл бұрын
    • Dude someone is talking through a toaster

      @tornadomash00@tornadomash004 жыл бұрын
    • hahahahahha 🤣🤣🤣

      @andrehen8645@andrehen86454 жыл бұрын
  • 3:43 No, you.

    @dandanthedandan7558@dandanthedandan75586 жыл бұрын
    • No he is right

      @kieranwalker2249@kieranwalker22496 жыл бұрын
    • *Reverse card*

      @loopyzach7537@loopyzach75376 жыл бұрын
    • Gabriel Barbosa He said "your mom gay" instead of "ur mom gay" so I'm following the trend.

      @dandanthedandan7558@dandanthedandan75586 жыл бұрын
    • *MIC DROP*

      @dandanthedandan7558@dandanthedandan75586 жыл бұрын
    • you mum gay

      @Dee-mm1bt@Dee-mm1bt6 жыл бұрын
  • Am I the only one who keeps on getting recommended old videos from him? Even when you think you binged them all somehow there is a new old one which you have never seen. ... Has Code Bullet hacked time???

    @dnaxdevil7391@dnaxdevil73914 жыл бұрын
    • He did that a few years ago ...or is it a few years from now? I can never keep things straight with time travel

      @chucknorify17@chucknorify174 жыл бұрын
    • Same

      @Speed001@Speed0013 жыл бұрын
    • Since you liked the newer ones, you get the older and thus more irrelevant ones

      @magical_onion9854@magical_onion98543 жыл бұрын
    • And also, they are probably just not exactly fitting for you from the AI algorithm. It's a robot, ya can't blame it that much.

      @magical_onion9854@magical_onion98543 жыл бұрын
    • Meeting too, watched all of the new ones then these just pop up lol

      @vanilla_MC@vanilla_MC3 жыл бұрын
  • What if you _combined_ hard-coded rules *with* neural networks and genetic algorithms, not only so that it can never lose on increasingly large boards, but also play at an increasingly faster pace. So it wouldn't just be a perfect Minesweeper player, but a Minesweeper _speedrunner._ One useful technique to teach it would be "1.5-clicking" as well as some no-flags techniques. And maybe throw some raycasting in there just for the sake of over-engineering it~

    @AmaroqStarwind@AmaroqStarwind2 жыл бұрын
    • over-engineering sounds like the last thing Evan would ever do

      @danielyuan9862@danielyuan9862 Жыл бұрын
    • theres no way to get better than polynomial time anyways since its a NP complete problem. Best implementations (without any mistakes possibly occuring) is sub exponential at best.

      @superfeel1275@superfeel1275 Жыл бұрын
  • jeez, coming back to OG code bullet is a trip.

    @ManiakPL22@ManiakPL222 жыл бұрын
  • I don't know that many people know this, but did you know that clicking the left and right mouse buttons at the same time has a unique action in Minesweeper? If you click on a number and that many mines are already flagged around it, all remaining unflagged squares are simultaneously clicked. This may speed up your AI a bit.

    @kujmous@kujmous6 жыл бұрын
    • No one will care or believe me, but I genuinely believe my brother is faster then this AI and this being a big part of it. On the largest size with easiest settings from memory he used to average less then 8 seconds, with 3 seconds being his fastest. He used to play so much minesweeper, its actually ridiculous haha.

      @Icetemplar@Icetemplar6 жыл бұрын
    • Trent 88 3 seconds??? You gotta show us one dude!

      @ProTyle@ProTyle6 жыл бұрын
    • It's called chording, and the best minesweeper players strategically use this function only when it is quicker to do so, otherwise they just don't flag the mine at all and just click to reveal. Because the win condition is not to flag all mines, it is to reveal all non-mines. Also note that there's a trick you can do where you hold down the flag click and drag to the chording tile and then finish the chord click. It saves you almost no time, but since you don't have to let go of the right click and then click it down again, it is marginally faster for incredibly fast players. And for these fast players the only thing slowing them down is the speed that they can click and move the mouse, so it's totally worth it.

      @MattMcConaha@MattMcConaha6 жыл бұрын
    • World record is 32 seconds on expert > www.minesweeper.info/wiki/World_Record_History , 8 seconds is likely impossible for any human being. Edit: unless of course you meant that its restarted game with known position of the mines, that might be doable..

      @QuadrapleTroll@QuadrapleTroll6 жыл бұрын
    • "largest size with easiest settings" sounds like custom game size and mine count to me. If you do the max size and minimum bomb count you can win in 1 click if you're lucky. I don't think they really know what they're talking about when they say 3 seconds is the fastest. This AI still isn't very fast though, for an AI. It's easy to see how inefficient it is just by how much bounces back and forth between the right half and left half instead of sweeping across it, or even just staying on one side until it's done. This one is fast: kzhead.info/sun/grJwosdloqGCmYU/bejne.html but doesn't win 100%. It wins an expert game in 2 seconds, so watch that and imagine this dude's brother being able to click that fast lol (he runs it at "human speed" first and then speeds it up at like 1:15)

      @nitzbitz1@nitzbitz16 жыл бұрын
  • I never even figured out how that game worked.

    @P1K3L@P1K3L5 жыл бұрын
    • I still don't understand. Even after watching this video

      @slyfox4547@slyfox45474 жыл бұрын
    • If there is a 1 it means there is only one bomb around the piece. If there is 2 it means two bombs and so on

      @orxanmamedov2671@orxanmamedov26714 жыл бұрын
    • look it up on wiki it'll tell you all you need to know

      @Slurp_Nation@Slurp_Nation4 жыл бұрын
    • +1

      @kacperzmuda6272@kacperzmuda62724 жыл бұрын
    • minesweeper, aside from the occasional 50/50 chances you have to take, is the easiest video game

      @goober8663@goober86634 жыл бұрын
  • Your code helped me out on the spots that cause me the most problems. I obviously can't do the probability solving your code can but you taught me how to treat two squares as one which is something I never considered before.

    @ThePrufessa@ThePrufessa3 жыл бұрын
  • "generate all possible bomb arrangements" - doesn't that lead to a combinatoric explosion?

    @dennisrkb@dennisrkb3 жыл бұрын
    • There are many ways to get around generating all combos for the the entire map at once. You would have to be insane to do that. It's simple: only generate all possible combinations for 5 tiles at a time

      @gabe8168@gabe81682 жыл бұрын
    • @@gabe8168 Could you elaborate a bit more?

      @dennisrkb@dennisrkb2 жыл бұрын
    • @@dennisrkb One way to mitigate the explosion is to notice that in untouched squares (squares with no clues touching it), all combinations within those squares have the same probability, so you'll only have to consider touched squares. As a math person myself, I've also realized that if you add all the probabilities of there being a mine within all the squares touching a certain clue, it must sum to that clue. I'm not sure how much that helps, but there may be techniques to minimize that chance. One last thing: this probably never applies until near the end where the only squares left are those where you have to guess, so there would be no combinatorial explosion.

      @danielyuan9862@danielyuan9862 Жыл бұрын
  • 1980: I bet you there are going to be flying cars and a cure for Cancer! 2018: I created the perfect Minesweeper AI.

    @syrenarch251@syrenarch2515 жыл бұрын
    • Speak for yourself, this video actually cured my cancer.

      @torginus@torginus5 жыл бұрын
    • Ehh potato potahto.

      @imabird1566@imabird15665 жыл бұрын
    • In Canada, they have the cure but the government won’t release the cure because they’re afraid they won’t get any credit, do maybe if they release it then our population won’t be so low for our size, the population will grow at a better rate Atleast

      @5ucode@5ucode5 жыл бұрын
    • 2118: I bet that the earth was not dying!!

      @haydengillanders7997@haydengillanders79975 жыл бұрын
    • Im a disappointment

      @noah-ns7lu@noah-ns7lu5 жыл бұрын
  • I lose 99% of my mindsweeper games cause I misclick WAY to much

    @cryochick6736@cryochick67365 жыл бұрын
    • No one realized that he said mindsweeper instead of minesweeper

      @darthvader8641@darthvader86415 жыл бұрын
    • *minesweeper *misclick *too

      @joops110@joops1105 жыл бұрын
    • Oh yeah, a typo will get you blowed up quicker than anything

      @bledlbledlbledl@bledlbledlbledl5 жыл бұрын
    • @@keenankersh7944 Thanks! English is not my native language, always happy to learn new things.

      @joops110@joops1104 жыл бұрын
    • I'm the same

      @skydivingisfun@skydivingisfun4 жыл бұрын
  • You should revisit this. Room for improvement include having the ai focus on one area at a time to reduce travel time and the utilizing the double click trick: if you left click and right click at the same time on a number that has all its bombs flagged it clears all remaining squares that are touching it.

    @thatoneginger@thatoneginger3 жыл бұрын
  • Just caught onto your channel and I wasn't sure if I was going to sub until I saw the I Love You scramble in the matrix code. Best wishes from a fellow sappy nerd.

    @Blunderful19@Blunderful194 жыл бұрын
  • I once created a game called Gossip that was a cross between Clue and House Party. Five guys and five girls all hooked up with somebody at a party in five different rooms, but the morning after, nobody could remember who they were with. Like, Clue, everybody had one random bit of information about who somebody was not with. "Emma was not with Alex", or "Alice was not in the Closet". etc. The challenge was to fill in all the blanks based on interrogations of things everybody is sure didn't happen. If Emma was not with Alex, Billy, Chris, or Danny, then she must have been with Eddy. If Eddy was with Emma, then he was not with Alice, Beth, Cathy, or Dana. And so on. Process of elimination. So then I had to code the computer AI to try to beat you to the punch on their turn. Oh, man. It nearly broke my brain. But I got it done based on a few rules of inductive reasoning. Then, when I added a recursive function to loop back through the logic tree after every new bit of information was uncovered, I found the AIs were way smarter than any hungover college student could ever be. Some of them cracked the case with only six or seven clues. So then the problem was not how to get them to solve the problem, but to get them to believably fail sometimes so there could be a "Easy" difficulty. I never did release the game because of issues around alcohol and consent, but it was fun to build.

    @kevnar@kevnar5 жыл бұрын
    • so many things wrong here.. like what made you think it would be difficult to be smarter than a hungover college student ?! and what did you put in their drinks to make them forget who they hooked up with ?! and most importantly... who the fuck tried to put alice in the closet?!?!?!

      @bongsesh@bongsesh5 жыл бұрын
    • This is the challenge most AI devs have to deal with. Making the AI is challenging enough, but staging it in different tiers is the really challenging bit. How do you dumb an AI down? Well, that's different for each situation. And it is often far easier to make the "perfect" AI than to make a challengingly easy AI.

      @morphman86@morphman865 жыл бұрын
    • Orgy

      @reindeergames3467@reindeergames34675 жыл бұрын
    • Imo it's OK to a game/piece of enternainment be a little fucked up if it itself realizes it (and warns about it) and doesn't fantasise it. (In most cases the purpose would be comedic): For an example Monopoly pedo edition would be fine. (Adults only of course)

      @metawarp7446@metawarp74465 жыл бұрын
    • @@metawarp7446 makes sense.. but in the current politcal climate, context isn't ever taken into account

      @nwa8169@nwa81695 жыл бұрын
  • *M A T H* and _PROBABILITY.._ made it very interesting to watch.

    @kenmendoza6932@kenmendoza69326 жыл бұрын
    • How do u do slanted words

      @brooked982@brooked9825 жыл бұрын
    • 'Hi'

      @brooked982@brooked9825 жыл бұрын
    • Brooke D _I dunno_

      @arkell7763@arkell77635 жыл бұрын
    • _wow_

      @yellowstonenationalpark6082@yellowstonenationalpark60825 жыл бұрын
    • -dude-

      @yellowstonenationalpark6082@yellowstonenationalpark60825 жыл бұрын
  • I would love to see how you get all these systems to interact with the game, awesome stuff!

    @CartmanBrah@CartmanBrah3 жыл бұрын
  • Pretty sure you can optimize time if you do depth-first instead of breadth-first, because large areas can be opened when going a bit deeper locally. Love your videos!

    @fUtal1mistake@fUtal1mistake3 жыл бұрын
  • plot twist: the recordings shown are actually ones of him playing sped up

    @ye_olde_troller@ye_olde_troller6 жыл бұрын
    • double plot twist: the recordings are him playing at his actual speed without any modification

      @quacc4748@quacc47486 жыл бұрын
    • Triple twist: It's slowed down footage of him playing subconsciously and he really believes it was his program doing it.

      @youtubeuniversity3638@youtubeuniversity36386 жыл бұрын
    • quadruple plot twist: This has been the case for all videos on this channel.

      @smith6810@smith68106 жыл бұрын
    • quintuple twist: all his videos are made up in your mind and your dreaming while watching the videos

      @Cinn07@Cinn076 жыл бұрын
    • Algorithms like these don't take a lot of processing time. The only reason it takes so long is because he deliberately set a mouse speed limit to make it easier to follow.

      @starcubey@starcubey6 жыл бұрын
  • One day he will upload a video titled: "Creating Skynet"

    @edu4561@edu45614 жыл бұрын
  • On my deployment I spent the majority of my free time playing it. I got really good at it. I found every time on the largest scale though, there is always a 50/50 click that determines your win or not, at least on the original.

    @yu-ger-bloob-highway3521@yu-ger-bloob-highway35214 жыл бұрын
  • "It's simple really" I knew it CeaveGaming is Code Bullet!

    @mrpokemon1186@mrpokemon11864 жыл бұрын
    • Devon Rogers yes

      @kornsuwin@kornsuwin3 жыл бұрын
    • Hooray!

      @axisred2301@axisred23013 жыл бұрын
    • ITs actually, surprisingly simple... *goes on for a full video.*

      @link_team3855@link_team38553 жыл бұрын
  • 3:48 bottom left

    @skyfirevoid@skyfirevoid5 жыл бұрын
    • Pokerxs it kinda looks like a face is that what your saying

      @ramengandalf7064@ramengandalf70645 жыл бұрын
    • Sonofwolf628 lol it says your mum gay

      @imthedarknight-8755@imthedarknight-87555 жыл бұрын
    • No u

      @Dragonofshame@Dragonofshame5 жыл бұрын
    • Pokerxs no u

      @Nunyuhbusniz@Nunyuhbusniz5 жыл бұрын
    • fuck you guys lmao

      @skyfirevoid@skyfirevoid5 жыл бұрын
  • You can make a better AI: To make choices of equal risk: (like the first few moves) have it prioritize the move that will give it the *most information* about the rest of the board. I wrote an AI very similar to this one to solve the "Thrill Digger" minigame in Skyward's Sword, and increased it's win rate significantly by giving it this secondary priority. (It had the Third priority of picking the square that netted you the most points in situations where they were equally risky and equally informative; but moves aren't assigned point values in minesweeper)

    @doommustard8818@doommustard88186 жыл бұрын
    • I like this! But also I feel the programing should incentivize clicking on the nearest certain safe spot to speed up the process. There were several times in the video where the computer would go back and forth across the board/field to click on knowingly safe spots.

      @DanielCopelandMD@DanielCopelandMD5 жыл бұрын
    • I'm talking about the situation where you get two places where you have two equally safe moves. Obviously if there are two places it knows are safe then it will eventually click both of them-- so it wouldn't matter. But lets say there are two (or more) places that each have a 20% chance of blowing up AND those are the spaces with the lowest chance of blowing up. It's better to pick the spot that gives us a higher chance of winning in the long run. We can both agree that emulating an entire game in this fractal manner would be incredibly slow, (unless you're on a super computer) but what we can do is choose the move that is most likely to reveal the highest number of safe spots, as one way of implementing this idea of "information". There are other ways to implement this but they take longer to explain. This matters the most during the 2nd through when it gets its momentum. As said in the video, once it gets its momentum it's good. The goal is to get momentum faster, so it spends less time in the dangerous state, where it has a very real chance of losing.

      @doommustard8818@doommustard88185 жыл бұрын
    • Sorry I like explaining things and get a little excited when I get to.

      @doommustard8818@doommustard88185 жыл бұрын
    • DoomMustard I get what you are saying and I agree with you. I was saying that in addition to that, having it clear out one section of absolutely safe spots before moving on would also speed it up. It spent most its time moving the mouse needlessly back and forth across the field.

      @DanielCopelandMD@DanielCopelandMD5 жыл бұрын
    • Daniel Copeland: I realized that after I finished typing it, but I spent so much time typing it. Hense the "sorry" right after

      @doommustard8818@doommustard88185 жыл бұрын
  • lmao that audio quality. I'm glad it's here for prosperity, and I'm glad his mic improved over the years.

    @titusfortunus2916@titusfortunus29166 ай бұрын
  • Its just crazy to see how far your channel has come in 3 years

    @ShizaanSil@ShizaanSil3 жыл бұрын
  • Me: The perfect minesweeper AI doesn't exis-. The Video:

    @JesusRodriguez-cg7qh@JesusRodriguez-cg7qh6 жыл бұрын
    • Jesus Rodriguez no likes? let me help you :)

      @wolverdep4739@wolverdep47396 жыл бұрын
    • Me: There is no most unoriginal comme-.

      @gravity9450@gravity94506 жыл бұрын
    • Me: I regained my faith in humanit-. tHiS ComMEnT:

      @sanderlahuis5698@sanderlahuis56986 жыл бұрын
    • Me: Ah there will be Normal Commen- These Comments

      @dragonx8361@dragonx83616 жыл бұрын
    • Me: the perfect meme-killing comment doesn’t exis-

      @joshe9409@joshe94096 жыл бұрын
  • Funny story. All the way into my teenage years, I didn't know how to play minesweeper; I didn't know what the numbers were for. I just thought it was a game where you randomly revealed squares and sometimes there were mines underneath. I hated it since I thought it was based on pure luck and was practically unwinnable... One day it hit me that I might have a few misconceptions about the game, and I was able to logic out how to actually play it.

    @thespaceace8164@thespaceace81646 жыл бұрын
    • somebody should make a film of your story.

      @paulgoogol2652@paulgoogol26525 жыл бұрын
    • Same, I thought it was the worst game ever, never really thought too much about it, it was just a free shitty game that came with Windows lol

      @daniellebarker7205@daniellebarker72055 жыл бұрын
    • 0000 Huh,that's funny

      @apollojustice5423@apollojustice54235 жыл бұрын
    • Press f1

      @PhilippeLarcher@PhilippeLarcher5 жыл бұрын
    • Same i hated it because it looked unbeatable but then i figured out.

      @Trowo@Trowo5 жыл бұрын
  • This has been sitting in my "Watch Later" playlist for TWO YEARS, ever since it came out! I'm so glad I finally watched it

    @jonahs92@jonahs923 жыл бұрын
  • I think your algorithm is not perfect since whenever it has to take a chance it should take into account the value of information of uncovering a square so that the risk is "worth it". E.g. in the first move all squares are valued equally but the center might have a higher value of information than a corner.

    @scepticusverisimillimenonm8450@scepticusverisimillimenonm84504 жыл бұрын
    • You are right, it seems to be much more challenging to build an alghorytm for that

      @francogiaretta9286@francogiaretta92863 жыл бұрын
    • A corner actually is more likely to have useful information, since there are only 3 neighbors which could have a bomb, meaning it if more likely to expand. Knowing how many bombs are around a single square isn't useful information, knowing how many bombs are around a grouping of squares is.

      @PaulBurg@PaulBurg3 жыл бұрын
    • @@PaulBurg having less neighbours means a lower chance to expand, not a higher one - each square has the same probability to have a bomb at the very start, since it is not 100%, the more squares, the less chance there is that all of them (surrounding the original pick) are a bomb Although if the AI was truly perfect, it would take in the probability of a blind guess compared to a logical guess of squares which do not currently have a definitive answer

      @PJOZeus@PJOZeus3 жыл бұрын
    • @@PJOZeus along with that, there is also the possibility of a 50/50 guess occurring

      @erwinsmith5921@erwinsmith59213 жыл бұрын
  • You should have added more bombs.

    @TheUKNutter@TheUKNutter6 жыл бұрын
    • every single square are bomn and left one space square so no one can win it

      @thedoge492@thedoge4926 жыл бұрын
    • Tom Tang: Actually, that'd be a instant win. The first tile you click on is guaranteed not to be a mine, so if there was only one square that wasn't a mine you would've already clicked it.

      @muizzsiddique@muizzsiddique6 жыл бұрын
    • Mu'izz Siddique, that's not true.

      @nexus1g@nexus1g6 жыл бұрын
    • Load up Minesweeper on Windows (most people are ever only talking about the Windows XP/Vista/7 version, there's one on the Windows Store by Microsoft) and make a custom game of 10x10 field with 99 mines. Try it. Don't play shoddy ports made by first time developers who are still learning to code.

      @muizzsiddique@muizzsiddique6 жыл бұрын
    • Mu'izz Siddique, maybe you're right on the newest version. In Windows 3.11/95 it was possible to hit a bomb on the first try.

      @nexus1g@nexus1g6 жыл бұрын
  • Maybe it can get better, if by better you mean "completing more games per hour". You can probably optimize and make it faster, but in terms of changing the logic, you could look at situations where it at some point HAS to take a chance, like if there is an island that can't be completed unless you pick a square with less than a 100% chance of not being a bomb. In that case you would be better off taking the chance right away and fail fast if you have to fail at all, rather than putting it off until the last moment.

    @Baekstrom@Baekstrom6 жыл бұрын
    • well actually it could end in a situation where there are more/fewer bombs on the board and therefore the chance changes - if it waits longer it has the best idea

      @Starwort@Starwort6 жыл бұрын
    • There are such cases where you already know how many bombs are in the island, so the rest of the board truly can't give you any more information.

      @AndrewKay@AndrewKay6 жыл бұрын
    • This is likely slowed down so it's visible for us to see. The computer probably can complete it in milliseconds.

      @descai10@descai106 жыл бұрын
    • (From a former addict.) It is a simple matter to play perfectly logically, so the game really is about racing the clock. The trouble, when it arises, is in clearing out the last of areas, when you can arrive finally at 50/50 gambles. So the most efficient play is always to try to finish areas completely so that if you are going to lose on a forced gamble, you find that out before wasting time doing the rest of the board. This flaw in the game is why I kicked the habit - as opposed to rewarding the player for getting better, the game ultimately punishes you. It always bothered me that it would have been a simple matter for the game to be programmed to check after the random mine placement, and scrub matches that could only be won by chance.

      @ianbentryn8306@ianbentryn83066 жыл бұрын
    • For probabilistic minesweeper complexity, see: arxiv.org/abs/1204.4659 The short of it: it's extremely hard, harder than solving np problems or simulating quantum computers. Widely believed to be impossible to do perfectly, but perhaps it could be approximated closely.

      @joshuacook2@joshuacook26 жыл бұрын
  • I picture the Super Saiyan 3 transformation dialogue going on during the end "crushing." :) And this is to go even further beyond!

    @Baalor204@Baalor2044 жыл бұрын
  • Epic. That probability approach 👌🏻

    @heddevanheerde@heddevanheerde3 жыл бұрын
  • 3:45 no u

    @jordray5823@jordray58235 жыл бұрын
    • 4:10 non youoy

      @leonardgolub7660@leonardgolub76605 жыл бұрын
    • Uno reverse

      @ZeZestyX@ZeZestyX5 жыл бұрын
    • ReeeeeeeeeeeeeeEEEEEEEEE

      @oscailly@oscailly5 жыл бұрын
    • rekt

      @Nugcon@Nugcon5 жыл бұрын
  • But can you use it on Minesweeper.io to wreck some noobs? :D

    @slimpwarrior@slimpwarrior6 жыл бұрын
    • Holy frick, that would be overpowered. But, then, there would be Gohan on there to save us all...

      @NoorquackerInd@NoorquackerInd6 жыл бұрын
    • DO IT, Code Bullet! Now we are talking!!

      @PauloDDD2@PauloDDD26 жыл бұрын
    • YUSSSSSSSSS

      @dandanthedandan7558@dandanthedandan75586 жыл бұрын
    • IIRC they rate-limit uncovered squares to deter bots, though.

      @ASalazarMX@ASalazarMX6 жыл бұрын
    • This AI is definitely effective, but sounds pretty inefficient. On a grid as big as that one, it may not be able to keep up. I know from experience that you can (or at least used to be able to; people might be better now) pretty consistently get first place by just using the first logical rule mentioned here, though.

      @Annile12@Annile126 жыл бұрын
  • he's come a ling way with his animations

    @imbadgamer9182@imbadgamer91822 жыл бұрын
  • Memories XD It's great little game, and this video was fun, and a great achievement!

    @hinteregions@hinteregions3 жыл бұрын
  • 4:48 for the skip

    @OddZodd@OddZodd6 жыл бұрын
    • thanks

      @CodeBullet@CodeBullet6 жыл бұрын
    • Whats the song thats playing at 4:48 ?

      @ov3rd0s3dgaming6@ov3rd0s3dgaming65 жыл бұрын
  • i dont even know how to play minesweeper normally

    @SpiritedSpy@SpiritedSpy5 жыл бұрын
    • Spirited Spy Basically the numbers mean how many bombs that square is touching. A bomb can be up, down, left, right, and diagonal. If there is no number there are no bombs around it.

      @oppanaenaestyle4758@oppanaenaestyle47585 жыл бұрын
    • don’t click the bombs

      @RedPandaGames75@RedPandaGames755 жыл бұрын
    • @@pewpewsalote8802 ok then what are the flags

      @petelee2477@petelee24774 жыл бұрын
    • @@petelee2477 they mark bombs, i think

      @theworstmaid@theworstmaid4 жыл бұрын
    • Wait it can be more funny : *When you don’t even know how to play mind sweeper in the first place*

      @graywasp5750@graywasp57504 жыл бұрын
  • really cool, I would get a screenshot and add a transparent box around each number darker depending on the risk and base my guesses on the grey scale.

    @aaronpriestley1500@aaronpriestley15002 жыл бұрын
  • The numbers looked so nice. I always thought that how many big numbers you can get. Kind of like a lottery.

    @ArnabAnimeshDas@ArnabAnimeshDas3 жыл бұрын
  • You should make it check the squares closest to the cursor at any given time that way it would reduce the time taken

    @Nickgowans@Nickgowans5 жыл бұрын
    • Im a disappointment

      @noah-ns7lu@noah-ns7lu5 жыл бұрын
    • It should avoid clicking any box unless it has a 0% chance of being a bomb. Clear an area, no 0%s, move onto a different area. Odds are, it'll attack that area at a different angle, or eventually work its way back to that area and clear some tiles that adjust the initial probabilities. Best of both worlds.

      @AnaseSkyrider@AnaseSkyrider5 жыл бұрын
    • @@AnaseSkyrider it would never get past the first few clicks if that was implemented

      @Lysergic_@Lysergic_5 жыл бұрын
    • @@AnaseSkyrider It already does that

      @jetison333@jetison3334 жыл бұрын
    • ENXJ then just click the square with the lowest possibility of a bomb if not zero

      @Andrew-gm6cl@Andrew-gm6cl4 жыл бұрын
  • Well it's not AI then, it's an algorihm.

    @LocatingGoku@LocatingGoku6 жыл бұрын
    • LocatingGoku That’s your opinion.

      @MalchiorDhar@MalchiorDhar6 жыл бұрын
    • Vulcan not even an opinion lmao, that's fact

      @LDMco@LDMco6 жыл бұрын
    • If that isn't an ai, then what exactly are enemies in video games? They don't learn and get better...so if those aren't ai, when what are they?

      @MalchiorDhar@MalchiorDhar6 жыл бұрын
    • A.I. Stands for Artificial intelligence. The term was specifically created to help search for "a computer program that was more than just an algorithm or list of instructions." So LocatingGoku is correct.

      @recklessroges@recklessroges6 жыл бұрын
    • and it's not perfect still a more accurate title than Trump tweets tho

      @captainLoknar@captainLoknar6 жыл бұрын
  • This helped me pass out thank you 🙏

    @wyattbrown4368@wyattbrown43683 жыл бұрын
  • This reminds me of the cinebench benchmark when it's rendering

    @ChrisRobinson-hl5sz@ChrisRobinson-hl5sz3 жыл бұрын
  • Title should be "I created a minesweeper algorithm."

    @Tristoo@Tristoo5 жыл бұрын
    • Textbook definition from wikipedia: "Leading AI textbooks define the field as the study of "intelligent agents": any device that perceives its environment and takes actions that maximize its chance of successfully achieving its goals." The agent in this video certainly qualifies. Also, every talk I've gone to about machine learning has clearly made this point: the modern self-learning neural stuff is called "machine learning", the term "artificial intelligence" is a much broader concept that includes hard-coded algorithms. That should be enough, but I'll also point out that in most computer games where you playing against "an AI" or "the AI", as is very commonly said, those AIs are almost always hard-coded. Very few computer games having neural-net-based AIs. So as much as you might want to argue that Code Bullet's bot is not AI, you're at odds with the definition used across most academic literature as well as common vernacular, which is about as close to being "wrong" as possible.

      @TheHuesSciTech@TheHuesSciTech4 жыл бұрын
  • It’s 3:00 am. Who needs sleep when I can listen to that soothing voice.

    @wilsonliang3044@wilsonliang30446 жыл бұрын
    • 2 am here, I agree

      @justiceforjoggers2897@justiceforjoggers28976 жыл бұрын
    • Cola BotelsOVA 3:11, I’m closer

      @valtrialastname2712@valtrialastname27126 жыл бұрын
    • Wilson Liang Funny thing is, it’s 3:00 over here as I’m writing this

      @btat16@btat166 жыл бұрын
  • The only way to make it better would be to figure out how the computer generates the field and use what has been solved to solve the random chance bits

    @johnweber4504@johnweber45043 жыл бұрын
  • Thanks for the good explanation!

    @Max25598@Max255984 жыл бұрын
  • i love how it's only been a year and your editing skills and mic quality have improved 100 fold

    @0xEARTH@0xEARTH4 жыл бұрын
  • pause at 3:44 and look towards the bottom left of the screen

    @tomanyknifes5874@tomanyknifes58746 жыл бұрын
    • MushyCrabs no u

      @rapid_meme_god@rapid_meme_god6 жыл бұрын
    • No u

      @rapid_meme_god@rapid_meme_god6 жыл бұрын
    • ToMany Knifes Yes, because we can't see it witout pausing.

      @launched_@launched_6 жыл бұрын
    • No u.

      @TheSaNdMaN5000@TheSaNdMaN50005 жыл бұрын
    • Look at the righr side

      @Shield-ul9tx@Shield-ul9tx5 жыл бұрын
  • The idea of doing it through probability is actually genius

    @jakobvanklinken@jakobvanklinken2 жыл бұрын
  • That would be a nice example for PyMC3 or similar. Those MCMC packages have some tricks to speed up simulation or even just get the MLE through more efficient optimization.

    @Andreas-gh6is@Andreas-gh6is4 жыл бұрын
  • Hey Code Bullet, I'd like to hear more about how you calculated the bomb arrangements for the probabilities. I made a Minesweeper AI myself a little while ago (no video, just a personal project) and I found that part to be extremely difficult, especially considering that the number of arrangements can reach into the hundreds of thousands even on a normal expert level board. I'm curious if our methods of solving that problem are similar since the math can get kinda tricky.

    @MathAndCarnage@MathAndCarnage6 жыл бұрын
    • Same I'm writing and report on it. Also what version he is using? Here is a presentation explaining what MathAndCarnage is talking about. It is written by the guy who proved it is impossible to find the perfect algorithm. web.mat.bham.ac.uk/R.W.Kaye/minesw/ASE2003.pdf

      @timothyhilditch@timothyhilditch6 жыл бұрын
    • My suggestion would be that all squares with no information about them are equal. So if you have a 1 as first you know there is a 1/8 chance for those, and the rest have (m-1)/(x*y-9). m i mines, x,y are the size of the field. if m is sufficiently high, this is more than 1/8 and we can pick any of the adjacent squares. But, the tricky part here is this: Does it matter if we pick a corner or a side? --- And what about the first move, should that be a corner, a side or in the middle of the field? They all have the same probability for a mine, but if they do not, what are the odds we gain useful information? And I have a suspicion this solver does not take those things into account, and thus I have proven that it is possible to create a better solver for mine sweeper. One standard size in timing for the minesweepers world records is 16x30 with 99 mines. This means the base odds for a mine is about 1/5. For a central position, there is a 1/5 risk of a mine at each of the nine positions, however, strictly speeking they are _not_ independent. If there is a mine on the top left, there is a 98/480 chance for one in the next, if not, the chance is 99/480. But if we ignore these small changes (thus making our solver worse) there is a 13% chance to get a 0 (which automatically expands, or we can expand with no further thinking). For a corner, there are only 4 squares to consider, so the odds of getting a 0 is about 40%. Of course, a 1 means the surrounding spaces has 1/3 of having a mine, sp we are much worse off in that case.

      @57thorns@57thorns6 жыл бұрын
    • What are you guys coding it with? C++/Js?

      @vis9487@vis94876 жыл бұрын
    • I'm coding in Java using Javafx. Also @57thorns first click does matter check out this www.minesweeper.info/wiki/Strategy#First_Click

      @timothyhilditch@timothyhilditch6 жыл бұрын
    • Yeah I know that code and math on a screen may not be the most mesmerizing visual but it is certainly fascinating stuff and I was very disappointed when the video just kinda skimmed over what I thought would be the interesting stuff. Also would be kinda neat if it could be optimized to win as many games as possible as fast as possible by taking into account how much information is revealed with each click. Sometimes taking a risk just doesn't tell you anything about an area making even a low bomb probability a bad choice over a slightly higher risk but much more informative choice.

      @Stephan-wf1ec@Stephan-wf1ec6 жыл бұрын
  • Code Bullet: Here's my perfect AI Also Code Bullet : *Gives an hardcoded solver*

    @quantumsoul3495@quantumsoul34954 жыл бұрын
    • this comment is underappreciated.

      @matteoar@matteoar4 жыл бұрын
    • @@matteoar ikr

      @quantumsoul3495@quantumsoul34954 жыл бұрын
    • But it is an AI.

      @sea81793@sea817934 жыл бұрын
    • ​@@sea81793 Well, no. An AI would learn by itself how to do this, the ability to autonomously learn from data and improve without having to change its program code defines an Artificial Intelligence after all, while he wrote every possibility and the best way to solve it. It's, as said, an hardcoded solver, a really good one at that, but it does not define as AI.

      @matteoar@matteoar4 жыл бұрын
    • Matteo A. I understand what you’re getting at, but your point is a product of “machine learning”. Machine learning is a form of Artificial Intelligence. It is capable of learning on its own(within parameters). Code’s minesweeper program is also a form of Artificial Intelligence. While it may not be self-learning...it is still able to achieve its goal through the knowledge it has been provided. medium.com/axiomzenteam/what-most-people-dont-understand-about-ai-and-the-the-state-of-machine-learning-ed007a987108

      @sea81793@sea817934 жыл бұрын
  • Look: You need to tell the code how many bombs there are. Then you give every tile the worth: 1-(nbombs):(ntotalfields) That means when you are in a 50:50 situation the bot just skips that and goes to another tile so it has the chance to uncover maximum space.

    @7own878@7own8783 жыл бұрын
  • You earned my like the moment you included, Perfection.

    @deleteduser2468@deleteduser24683 жыл бұрын
  • it's really really good but it's not perfect. the first move shouldn't be completely random, even though all the squares have the same probability of containing a bomb. The corner for example would be a bad move, because in the case that it isnt a bomb, you wouldn't gain as much information about other squares. I imagine that similar but more complicated decisions issues would exist once the game is in progress where multiple squares both have equal probability of being a bomb, but one would give you more information, and therefore give you a higher probability of winning the game. it's really good though.

    @Jennifer-ri9nc@Jennifer-ri9nc6 жыл бұрын
    • Underrated comment! I like your way of thinking :)

      @thomasritter2183@thomasritter21836 жыл бұрын
    • Thomas Ritter Thanks, Thomas!

      @Jennifer-ri9nc@Jennifer-ri9nc6 жыл бұрын
    • Actually I always start with the corner in minesweeper. You have a much higher chance of opening a patch with useful information as opposed to a single number which doesn't tell you anything.

      @Trixbeat@Trixbeat6 жыл бұрын
    • That's an interesting point! Is there any data about that or are you judging from experience?

      @thomasritter2183@thomasritter21836 жыл бұрын
    • how many games of minesweeper does it take for experience to become data?...the first square you click will never be a bomb, so starting the game on a corner both ensures there is no bomb there, and solves one of the corner squares which has a high chance of a 50/50 choice since there are at most 3 squares providing clues about its status...that being said, you will not likely be able to solve the whole board without having to make subsequent guesses elsewhere, hopefully opening a patch to end the guess work for a moment

      @maxfamilant246@maxfamilant2465 жыл бұрын
  • Would've been a bit more interesting if for the larger maps there were more bombs, good video!

    @tomburris8380@tomburris83806 жыл бұрын
  • You could make it faster, if you implement that if the AI detects a fully filled Number it does the left+right click thing to remove all the surrounding unflagged fields. Great vid!

    @DeadlyDwarf@DeadlyDwarf6 ай бұрын
  • Holy cow, code bullet has grown well

    @neiljeffersondiaz5691@neiljeffersondiaz56913 жыл бұрын
  • Sometines Minesweeper generates maps which just can't be solved with all of these rules. So your AI would just rely solely on probability. I'd recommend adding another rule: If we solved everything that we were 100% sure in and now we're left with space which can't be solved with our rules => calculate where the bombs that are left have to be. We got the exact number of bombs left and the "unsolvable" space. Yea, in some cases even this wouldn't work, but solvability percentage will rise and the AI will be even more PERFECT. P.S. well... it would be kinda hard to implement this I guess...

    @Furiousd@Furiousd6 жыл бұрын
  • Honestly I didn't know you could flag bombs in minesweeper so this video happens to be very educational for me.

    @herohuntr@herohuntr5 жыл бұрын
    • Geez did you just mark the bombs?

      @alexwang982@alexwang9825 жыл бұрын
    • Pi no i just tried to remember where they were located

      @herohuntr@herohuntr5 жыл бұрын
    • @@herohuntr same i never knew you could flag them, i just click and avoid bombs haha

      @hudnoraa1264@hudnoraa12645 жыл бұрын
    • Hero Huntr I’m not the only one.

      @epicawsomeguy208@epicawsomeguy2084 жыл бұрын
    • if u use linux like i do, then [sudo apt-get install xbomb] installs minesweeper

      @jeffandmark5373@jeffandmark53734 жыл бұрын
  • I have been looking for this.

    @joanwinter6525@joanwinter65253 жыл бұрын
  • Love your videos mate, would there be any chance you do a video on how to download the code and run it?

    @mariopalenciagutierrez4318@mariopalenciagutierrez43184 жыл бұрын
  • Maybe a revised version might help soldiers in the field... Or not...

    @circli@circli6 жыл бұрын
    • the minesweeper game needs to know where the bombs are, a critical bit of information not available in the war zone

      @arielsproul8811@arielsproul88116 жыл бұрын
    • If you can find the solution in polynomial time, it might. (Well, and you'd be filthy rich.) Because Minesweeper is NP complete. sed.free.fr/complex/mines.html

      @satibel@satibel6 жыл бұрын
    • What? You mean in actual war zones, the dirt you're standing on doesn't tell you how many mines are around you?

      @NikkiTheViolist@NikkiTheViolist6 жыл бұрын
    • At 5:35 to 5:45 it leaves a big line at the bottom, which it later solves. What is the reasoning behind this? Is it just always doing rule one until no more rule one is possible and so rule 2 and eventually rule 3???

      @TheRealDrWho@TheRealDrWho6 жыл бұрын
    • xchiltonx Those lines have no tiles with a 0% chance of not being a bomb. I just realised that my last sentence is kind of triple negative.

      @Kasamori@Kasamori6 жыл бұрын
  • 4:47 is when it starts.

    @dxnny162@dxnny1626 жыл бұрын
    • Daniel Gonzalez thanks bro

      @bananabus4208@bananabus42086 жыл бұрын
    • Thanks bro.

      @L0j1k@L0j1k6 жыл бұрын
    • u r lifesaver.

      @itzm1c155@itzm1c1556 жыл бұрын
    • Thank You!!! When I saw skip to ??? I knew my savoir would be in the comments

      @onlyme8780@onlyme87806 жыл бұрын
    • 0:00 is when it starts if you have an attention span longer than a gold fish's

      @madcalicoa1204@madcalicoa12046 жыл бұрын
  • Much love code bullet!

    @kevinmccarthy155@kevinmccarthy1552 ай бұрын
  • Finally my uncle who is bored with his office job every 1 hour before leaving hour can now see the end of minesweeper

    @ahhyesstoinks4058@ahhyesstoinks40584 жыл бұрын
  • Awesome stuff! However, I feel like speed could be improved a bit. Sometimes it goes from one place to another for no good reason. If two or more squares have the same (highest) probability, it should go for whichever is the closest to the cursor right now.

    @JeyPeyy@JeyPeyy5 жыл бұрын
  • 1:25 Skip to ??? ?

    @koosnaamloos4291@koosnaamloos42916 жыл бұрын
    • yes. obey the rules

      @jamesminor8805@jamesminor88056 жыл бұрын
    • xxZ0MB1E Ended up tearing space-time fabric, sewing it back together right now

      @koosnaamloos4291@koosnaamloos42916 жыл бұрын
    • crap

      @jamesminor8805@jamesminor88056 жыл бұрын
    • He probably meant to fill that in in editing

      @Cinn07@Cinn076 жыл бұрын
    • Koos Naamloos 4:47

      @Mystery_Biscuits@Mystery_Biscuits6 жыл бұрын
  • You can make it better if you program in the equivalent of clicking both right and left buttons of the mouse on a number that already is touching all possible bombs. For example if a 1 is already touching 1 bomb, and you click on that one with both the right and left buttons of your mouse it will automatically reveal all possible squares. This would allow your AI to finish, at least twice as fast as it currently is working, as it would have to select half as many squares.

    @coltonthompson5978@coltonthompson59784 жыл бұрын
  • As someone who can't even solve a 10x8 grid, seeing an AI of all things solve a 64x36 grid makes me kinda contemplate life.

    @dorchcorporation7578@dorchcorporation75785 ай бұрын
KZhead