I Created a PERFECT SNAKE A.I.

Code Bullet

Code Bullet

3 961 360 Views4 107

    I used math, science and tears to create a snake AI which always wins (sometimes).
    Massive thanks to brilliant.org for supporting this episode, check them out here: www.brilliant.org/CodeBullet
    Also check out John Tapsells work: johnflux.com/
    Heres my stuff
    Twitter: twitter.com/code_bullet
    Patreon: www.patreon.com/CodeBullet
    Discord: discord.gg/UZDMYx5
    Art created by @Dachi.art instagram.com/dachi.art

    Published on 7 days ago

    Comments

    1. AuNSHiVA Gibbons

      Hello there, Snake Bullet

    2. A. West

      How could a Hamiltonian cycle snake crash? Was the head just following the tail, which would take a while to reach the last two. How do you define when to jump? By a ratio of snake length to jump gain. Could you use an AI? How do you define your path? I presume randomly. Could this also use AI? This snake algorithm will always win but not quickly. Improving path and jumps it'd be faster.

    3. Thori Am

      When you asked if they were done killing Adrian, you should’ve had them respond with “Ladies and gentlemen... WE GOT HIM.” Would’ve been comedy GOLD.

    4. Forever Alpha

      21:15 almost killed me I WHEEZED JAJAJA anyways, aren't we going to talk about Evan's edditing skills are getting better?

    5. WonderFoxGD

      Lil too extra

    6. Night Shade

      Solve Your enigma machine please!!!

    7. Griffin Cook

      after the bot beats a game you can solve the maze it creates

    8. Zeraybifive

      Ah, yes, cooler Pyrocynical.

    9. Eclectic

      Could you "brute force it" and just set the snake to go back and forth over ever square leaving a path to return to the start? Then just repeat?

    10. _ Wolfynstine

      Just recently found your stuff. I absolutely love your personality and the stuff you do is really cool too haha

    11. marcin1693

      Can someone make it in Wallpaper Engine? I would be so satisfying to just watch it for hours.

    12. John Marshalll

      I think I see what went wrong at the end. The snake took a shortcut towards the end which resulted in cutting out 2 open squares to maneuver. Those 2 open squares cannot be recovered until the snake runs the entire length of the Hamiltonian Cycle and comes back to the point of where the shortcut was made. Then it would not take the shortcut, but follow the Hamiltonian path and regain the all the squares needed. This should be easy to demonstrate on a 4x4 grid.

    13. Kaizerdidrik YT

      anyone else find this really satisfying?

    14. Livingamer29

      The ai ay the end looks like a alien trying to communicate with their native writing 🤣

    15. West

      alternate title: guy loses his shit making a game of snake

    16. Adam Záliš

      New video idea. Maybe you could try to create "perfect" A.I. For the dinosaur game on chrome when you are offline. It may be pretty funny video.

    17. Ru Miak

      A new cool screen saver!

    18. qShadow

      A.I. Leans to play Osu! God i would like to see that...

    19. Kyle Mielke

      I know you said you're done, but... It strikes me that I play snake in 2 phases: Collection, and consolidation. During collection, sure I just grab the "fruit" but then I work to consolidate my body into contiguous space in the map, usually using an algorithm so I know the order my body will clear the area. Writing the snake to switch between the phases and know how long its body is (something humans instinctively check) and ensuring it consolidates to an area of the field similar in size to its total length should create a successful "human-like" performance. It should also be fairly fast, because it doesn't care where the fruit is until after consolidation, but early on, consolidation check always comes back true.

    20. kristene humphrey

      I wonder if this this is how they make bar codes lmao

    21. IMTG Music

      I think everyone should watch the video just for the 21:16 moment

    22. Zeddex

      "cool cool cool cool cool cool cool"... could he b a b99 fan

    23. Adolf Hitler

      ehm what about just running through each cell in the same path, wouldnt that always guarantee the snake to get all food

    24. MLG GD

      have you ever thought of using this as art?

    25. SeaGL Gaming

      Did Code Bullet create the perfect Snake AI? Well yes, but actually no.

    26. Lт. Auтυмп ツ

      Watch at x2 speed. Holy..

    27. asailijhijr

      19:40 your shake game has evolved into a game of life.

    28. asailijhijr

      3:03 GPS doesn't tell you when you've missed the turn anymore and that's often annoying. It'll send me around the block when I could just do a U-turn.

    29. Rintach

      Are you ai???

    30. stingerdragon

      Did you make an ai for the start since I think it's has a bullet in it's system:)

    31. superdestructo

      Meanwhile in Civ VI..

    32. Xam1

      can you make an AI for Super Hexagone?

    33. Shinryu Hazama

      Music name?

    34. Saad Bougrine

      What is the name of the programm he uses to programm interfaces such as the enigma machine using c??

    35. wildgoosespeeder

      The missing square at 20:50, the AI is perfect. I analyzed the frames in the video leading to what looks like a stalemate and there is no "cornered head". You just can't see the head moving towards the food and the tail being chased by the head because you made the snake as a whole one uniform color. Unless the AI freaks out because it thinks the tail will be in the way if it were to advance where the tail currently is. To put it simply, it can't see one step ahead, like it can't envision the tail not being where it wants to advance? This could be the classic "off by one" programming error.

    36. Ben's BatCave

      I bet this would be a great algorithm for a PCB auto routing software.

    37. VirusJD

      see you all in _2020_

    38. gnome gnomed

      Bruh i would slowly pound you

    39. Henrik Brandt

      What programm/engine is he using for programming stuff?

    40. Axeltha Green

      Hes back my fellow bullets

    41. Robin Michiels

      "Ok now that we've caught up" *video starts buffering*

    42. Joshua Alcazar

      This is giving me so much anxiety.

    43. vinasu maaj

      I feel like a homeless man tripin balls trying to focus on something when watching this

    44. HolyGame TV

      >Boost Boost Boost Is that a motherfucking HS DxD reference?

    45. Akiyama Joji

      Hey CB! I'm new to your channel, and despite your hyper-eccentricism which you're probably an ENFP. I'd love to watch more!

    46. TheDarkSatirist

      Why do you only sometimes censor your language?

      1. vinasu maaj

        Ah, Code Bullet's arch nemesis, the Bode Cullet

    47. JhihYang Wu

      Hey Evan You inspired me to create my own AI channel by not uploading regularly us-new.com/online/video-Jqf3q9R6RjY.html

    48. Lionidas

      Cool snake 1 8:33 Cool snake 2 17:34 For those who can’t spend 20 minutes of their time.

      1. Lionidas

        19:23 for the failure

    49. VoltOfficial

      17:51 the points look like MLG airsoft hit markers lol

    50. yuuto144

      This is too edgy... I'm in.

    51. Verge Top 5

      Which language do you use

    52. Miki_Poznan

      2.9514790517935E+20 moves :) maths

    53. Gus Tas

      Code Bullet: The snake A.I doesn't give a shit about the apple Snake A.I: Goes for the apple anyway

    54. Quinton Waldron

      there's got to be an easier way what if you just have the snake constantly follow the same path covering the whole screen over and over. guess that wouldn't really be AI though

    55. XxBlueScixX

      Make an AI that codes itself

    56. Nick

      Heeeey that's cheating! :D Again! And true A.I.

    57. AmenoKoyane

      bruh he's using light mode in his code editor cringe

    58. heehae

      Apologies if someone already suggested this but.... wouldn't it make your end game much more efficient if you altered the hamiltonian algorithm to try to back fill as much space as possible with its tail? New food can only spawn in empty spaces, so if you could block out entire sections of the map with your tail then it would allow for much easier pathing to the next food, making the last like 2 hours of super snake much faster. The idea is to predict future spawns of the food and try to keep it in front of the head. Thoughts?

    59. A Good Boi

      noodle stimulator

    60. Aiden Ellis

      You should make an A.I. that defeats Egg, Inc.

    61. OscarTheVirgin

      Ah, Code Bullet's arch nemesis, the Bode Cullet

    62. Must Stay Anonymous

      20:10 My intestines trying to digest that bag of doritos

    63. Aidas Baranauskas

      I love how the snake became the lack of snake in the end

    64. Clark Kent

      1:40 LMFAO

    65. The Majestic Phoenix

      Why... in the fuck... is this in my suggestions list, why the fuck did I even watch this and how in the living fuck is a video this young already near 4M views?! I'm astounded and I'm proud to have watched this :o

    66. Danger VelCas

      wich snake eats apples?

    67. Skywalker Who

      I have a perfect snake

    68. Remynator92

      u shoud try to make a tetris AI

    69. Shubham Jadhav

      @20:12 it looks like leaves are flying

    70. tpa nash

      Minesweeper is next