Snake Game in C++ in 20 minutes (Tutorial) -

Snake Game in C++ in 20 minutes (Tutorial)

Ertjan Arapi
Views: 21602
Like: 302
Today I built a simple snake game in C++ programing language around 20 minutes.


  1. I am about halfway and it is working fine, but I still don't understand WHAT the lines of code are doing. I am doing this to learn, but I still don't get it. For example, why am I writing rand() % height? How does that give the "correct" random location of the fruit? Why is "if(j == 0 || j == width – 1){" the width MINUS one? I don't get it.

  2. You also need to check if the food spawned inside the snake and generate new random coords until it isn't.

  3. This tutorial is identical to another one on YouTube. Search: C++ Tutorial 18 – Simple Snake Game (Part 1). Somebody copied somebody.

  4. anyone can help me the snake isn't move when i press the keys i have tried every way .

  5. look at me , im the coolest guy 🙃 says:

    oh god i use about 8 for loops to make the snake run =v

  6. pse se ke bo linkun o burr se na lodhe tu shkrujt krejt ket kod

  7. 0:51 i really said, and iostream, you added iostream, i said and conio.h XD, and you added conio.h, i said graphics.h, wait nono i think it would be windows.h, you added windows.h

  8. good video, but the only thing that isnt working for me is the rand()

  9. Can you please give me the source code file

  10. Light background made me skip this video. Change to dark better for your eye and ours <3

  11. hey, i followed everything, have not a single error in my code and my snake just wont eat the fruit, i am a total beginner on coding and wanted to follow along to get a better understanding, i am using windowsvisual studio 2022,

Leave a Reply

Your email address will not be published.