AI learns to play 2048

  • Published: 06 July 2018
  • I created an AI to play the game 2048, his name is Thomas
    Huge thanks to for supporting this channel check them out at

    I have twitter now. Yay
    follow me to fill the void in my heart

    Become a patreon to support my future content as well as sneak peaks of whats to come.

    Check out my Discord server

    I know heaps of people are going to ask so here is the music

    Mirror Mirror - Diamond Ortiz
    Smiles for miles - Silent Partner
    Hyperspeed - eveningland
    Gypsy Dance - Topher Mohr and Alex Elena
    Etherial Chior Ascends - Doug Maxwell
    Wishful thinking - Dan Labowitz

Comments • 5 605

  • Demon Slayer
    Demon Slayer  6 hours back

    I know this is stupid but it annoys me that they only spawn in two-

    • Corlaren
      Corlaren  9 hours back

      i may be a bit late to comment here but i'm kinda irritated by the name of this video.

      the name is "ai LEARNS to play 2048" but in the end you use a algorithm without a learning function (which is actually no AI in the common sense of the word nowadays).

      or maybe i'm just missing a point somewhere or i got something wrong, in which case i may apologise.
      im not a native speaker and i misunderstand things rather quickly.

      • Chess Gremlin 69
        Chess Gremlin 69  21 hours back

        Can anyone tell me what os he is on and what program and programming language he is using here?

        • 陳仲肯
          陳仲肯  24 hours back

          How about solve 2048 or tetris in MuZero's way?
          That will be quite interesting!

          • TODER HAVV Lodernut
            TODER HAVV Lodernut  2 days back

            10:12 WRONG! YOU GET A ZERO

            • OXMOND Tutorials
              OXMOND Tutorials  2 days back

              Great stuff! Well done! 👍🤓❤️

              • Jeremy Chan
                Jeremy Chan  2 days back

                Couldn't Tommy just have won @9:08 ? Or did the path finding not value a winning game state that high

                • Patrick Moloney
                  Patrick Moloney  3 days back

                  "Wheres the second enigma machine video? You promised us!"
                  Fuck off Clarence.

                  • Avram Levitter
                    Avram Levitter  4 days back

                    A genetic alorithm might still be useful, maybe apply it to the function that evaluates a board value?

                    • Julius Becker
                      Julius Becker  7 days back

                      But can it reach 4096? :D

                      • حديفة جوهري
                        حديفة جوهري  7 days back

                        code please !!!! where can i found the source

                        • George Cummins
                          George Cummins  1 weeks back

                          what language is this

                          • Sushant Salil
                            Sushant Salil  1 weeks back

                            what is that code editor that you are using!?

                            • 227Morgan
                              227Morgan  1 weeks back

                              EVERYONE Please go to Movetoamend (dot) org and Represent (dot) us. Sign the petition and get involved! Our political system has been rigged against "We the people" for the benefit of large corporations for far too long. Call your representatives and tell them to co-sponsor HJR 48, the "We the people" amendment, to say that 1) a corporation is not a person and 2) money is not free speech. It's time for the people to rise up and claim in one voice that we will be heard!

                              • J. McAllister
                                J. McAllister  1 weeks back

                                Can we have part 2 of the enigma video plz?

                                • Thomas Withaar
                                  Thomas Withaar  1 weeks back

                                  I feel personally attacked by your AI's name

                                  • A FUCKING KISKA
                                    A FUCKING KISKA  1 weeks back

                                    Tomas: daddy, why did you create me dumb?

                                    • Flexn Rex
                                      Flexn Rex  2 weeks back

                                      2:16 - 2:32 thats the feeling you get at 3 o clock at night trying to solve coding problems

                                      • anonymous
                                        anonymous  2 weeks back

                                        Can you share your code plz

                                        • Kevy
                                          Kevy  2 weeks back

                                          michael reeves and you should collab

                                          • Kanzu999
                                            Kanzu999  2 weeks back

                                            I never saw this channel, but the content seems amazing! Do we ever get to see how the AI is programmed as well?

                                            • Oskar Bekkelund
                                              Oskar Bekkelund  2 weeks back

                                              There is a pattern/algorithm or whatever you wanna call it, that I believe is better than the keep-going-a-direction-until-you-can't-then-switch-direction. It's up, right, down, left, up, right, down left. It basically makes it go in circles and you can obviously go both clockwise and counter-clockwise. Idk if that's harder to code or not tho. I just wanted to let you know. Keep up(or not if you don't want to/feel like it) the great work and amazing content. Love from Norway

                                              • Mallory Moore
                                                Mallory Moore  2 weeks back


                                                • Gupie Dziecko
                                                  Gupie Dziecko  2 weeks back

                                                  you can just swipe clockwise.
                                                  its that simple.

                                                  • Kane newbrook
                                                    Kane newbrook  3 weeks back


                                                    • 岚Galaxy Potato
                                                      岚Galaxy Potato  3 weeks back

                                                      My best score is 1024 😭

                                                      • Kappa Musics
                                                        Kappa Musics  3 weeks back

                                                        VLW fion BR que ja identifiqui

                                                        • 1969man
                                                          1969man  3 weeks back


                                                          • Nathan Burrill
                                                            Nathan Burrill  3 weeks back

                                                            Tetris ai

                                                            • Jeff Van Earwage
                                                              Jeff Van Earwage  3 weeks back

                                                              O This is bob 1 like = 1friend

                                                              • Precious Akpieyi
                                                                Precious Akpieyi  3 weeks back

                                                                You know google is reading your data when you play the game, fail at it then find this in your youtube recommendations.

                                                                • Zitro 99
                                                                  Zitro 99  3 weeks back

                                                                  So thomas is just a crappier Dr. Strange then

                                                                • TFK 001
                                                                  TFK 001  3 weeks back

                                                                  "A...I... What does the A stand for?"
                                                                  "The I--"

                                                                  • saruwatari shohei
                                                                    saruwatari shohei  3 weeks back

                                                                    next, let AI learn how to do a 4096

                                                                    • Bryan Lariviere
                                                                      Bryan Lariviere  3 weeks back

                                                                      in an actual run i managed to get 2048, but my luck was on key, the numbers just kept lining up they way i needed them to. In the end i didn't even get an addition 64 after the 2048 but i was still happy i got the 2048.

                                                                      • Dave Smith
                                                                        Dave Smith  3 weeks back

                                                                        What code u using

                                                                        • the roblox core destructor

                                                                          3:09 here it is pretty sexy right

                                                                          • Hm lam
                                                                            Hm lam  3 weeks back

                                                                            Plot twist: It’s played by a expert.

                                                                            • Poison_ Plays
                                                                              Poison_ Plays  3 weeks back

                                                                              Am I the only one who can get 2048 without an AI
                                                                              now I feel like a nerd

                                                                              • Txoka
                                                                                Txoka  3 weeks back

                                                                                A much better aproach to this is making an ai that evaluates gamestates and use it to evaluate best future gamestates... or maybe looking more forward to the future and using a normal evaluating formula that takes in acount also that the more left spaces the better the state is, and not mantaining the biggest in one corner but just giving extra points to the state from the higest

                                                                                • synchronium24
                                                                                  synchronium24  3 weeks back

                                                                                  What programming language is this?

                                                                                  • Ahmed Zainoon
                                                                                    Ahmed Zainoon  3 weeks back

                                                                                    1:38 the squares gone faster than sonic

                                                                                    • hbons
                                                                                      hbons  3 weeks back

                                                                                      the same numbers doing a fusion dance. HMM... sounds like steven universe to me

                                                                                      • Jacob White
                                                                                        Jacob White  3 weeks back

                                                                                        Thomas, you dumb f***. That is a great quote

                                                                                        • EditorFredsterr
                                                                                          EditorFredsterr  3 weeks back

                                                                                          dis is monetised

                                                                                          • NutellaPancake _12345
                                                                                            NutellaPancake _12345  3 weeks back

                                                                                            Ai learns to play Tetris
                                                                                            Everyone like and recomment this so he can see

                                                                                            • corey Virgo
                                                                                              corey Virgo  4 weeks back

                                                                                              dont worry!! i dont plan on abusing the subscribe button for the time being

                                                                                              • TheCentaury
                                                                                                TheCentaury  4 weeks back

                                                                                                The real 2048 game doesn't put only the number 2 as new random tile but also number 4...