C++ Tutorial 18 - Simple Snake Game (Part 1)

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024

Комментарии • 1,3 тыс.

  • @pR1sooeem
    @pR1sooeem 6 лет назад +1642

    "So if we run our programm now..... we get something that's..not good...."
    Bro, i feel you so much

    • @shaggiel3099
      @shaggiel3099 4 года назад +13

      Yea, this is the only guy I’ve seen who’s used that term, sadly.

    • @rajahussainabbaxi8940
      @rajahussainabbaxi8940 4 года назад +3

      In snake game part 1 , compiler occur an error that 'rand' was not declared in this scope
      Please reply me Please, ,

    • @danielgorokhov3457
      @danielgorokhov3457 4 года назад +2

      @@rajahussainabbaxi8940 dude, send ur code here

    • @rajahussainabbaxi8940
      @rajahussainabbaxi8940 4 года назад +2

      @@danielgorokhov3457 thanks,, I watch complete code from your comments and also highlight my mistakes,, again thanks for your reply,,
      It's amazing code 😍

    • @Tony-lp8hy
      @Tony-lp8hy 4 года назад

      Raja Hussain abbaxi do you have #include or . Or did u just use rand and forget its rand()?

  • @dragonturd21
    @dragonturd21 3 года назад +780

    Tip for all new guys that are here. If you highlight a line of code, hold alt button and use Up/Down arrow keys to move the entire line

  • @i_inject_crayons9473
    @i_inject_crayons9473 3 года назад +104

    i feel like these sort of tutorials are way better than "programming tutorials" because this guy actually shows us how to use th code we learn

    • @tyapnekadegaming7997
      @tyapnekadegaming7997 2 года назад +1

      sadly he quit youtube

    • @redwar7253
      @redwar7253 9 месяцев назад +3

      The difference between learning to code and learning to make a program

  • @andtpfack8243
    @andtpfack8243 8 лет назад +573

    easy to follow can recreate the code while the video is running. No useless bullshit just straight to the point, i love it. You earned yourself a sub !

  • @mr.mowgee2240
    @mr.mowgee2240 2 года назад +11

    tbh, im just here to see how the experts do it their own way, i'm a begginer at C++ and prolly noob.
    but this video motivates me to learn and practice harder (since i'm self taught), now i realize i have a loooong way to go. and it makes me excited. 🔥

  • @teodortodorov1662
    @teodortodorov1662 3 года назад +74

    My brain: What did you just watch?
    Me: Programming.
    My Brain: So, what did you understand?
    Me: Nothing

    • @worldshaper1723
      @worldshaper1723 3 года назад +1

      @dark tv Great advice. Brother I wish everyone understood they do not need to understand much in the first day.

    • @yodagaming3003
      @yodagaming3003 3 года назад +3

      @denisucuuu don't use "using namespace std;". just don't.

    • @gamesholplays7162
      @gamesholplays7162 3 года назад +1

      dobre

    • @christianr.5868
      @christianr.5868 2 года назад

      @@yodagaming3003 why though?

    • @cluelessnoob4138
      @cluelessnoob4138 4 месяца назад

      ​@@yodagaming3003why?

  • @dreamhollow
    @dreamhollow 5 лет назад +26

    I really appreciate this.
    I know this tutorial is very old by now, but as someone who is just getting into C++ recently this has been very enlightening to me.
    Thank you!

  • @cgme9535
    @cgme9535 2 года назад +4

    I haven't worked with game development in a long time. Thank you for making this video, even though it was over six years ago.
    More than anything else, I liked that you assumed we knew the basics of programming. Explaining the basics wastes too much time.

  • @theencube5379
    @theencube5379 8 лет назад +59

    if c++ doesnt recognize rand include this: #include

  • @dariuschandra1670
    @dariuschandra1670 8 лет назад +36

    Thanks for the tutorial bro,it motivated me to learn more about C++

  • @PaulBlxck
    @PaulBlxck 8 лет назад +217

    This is going to be my first year project (and my first ever game) hopefully it works out. Thanks!

    • @loveuandrew897
      @loveuandrew897 5 лет назад +7

      Paul SZ lmao

    • @quyngo1999
      @quyngo1999 5 лет назад +12

      Did it?

    • @chrissmith1152
      @chrissmith1152 5 лет назад +4

      me too

    • @PaulBlxck
      @PaulBlxck 4 года назад +37

      @@EinMeister it went great, thanks for asking. In fact that project sparked my love for programming and I'm now studying Artificial Intelligence. It's amazing.

    • @PaulBlxck
      @PaulBlxck 4 года назад +10

      @@EinMeister dude, just make a few small scale games (may be some 2D runners) and then when you're confident learn about AI in games (reinforcement learning). Its so freaking fun!
      Wish you the best, my friend.

  • @rexmagotia
    @rexmagotia 6 лет назад +29

    Adding 2 units in the for loops to make the first and the last line of the map could be replaced with the

  • @jeydii5409
    @jeydii5409 5 лет назад +219

    this is the code #include
    #include
    #include
    #include
    using namespace std;
    bool gameOver;
    const int width = 20;
    const int height = 20;
    int x, y, fruitX, fruitY, score;
    int tailX[100], tailY[100];
    int nTail;
    enum eDirecton { STOP = 0, LEFT, RIGHT, UP, DOWN};
    eDirecton dir;
    void Setup()
    {
    gameOver = false;
    dir = STOP;
    x = width / 2;
    y = height / 2;
    fruitX = rand() % width;
    fruitY = rand() % height;
    score = 0;
    }
    void Draw()
    {
    system("cls"); //system("clear");
    for (int i = 0; i < width+2; i++)
    cout

    • @bellamycat9800
      @bellamycat9800 5 лет назад +2

      Jd gaming thanks

    • @chabdullah4805
      @chabdullah4805 5 лет назад +8

      bro i copied that code and my program dosent run
      whats the problem

    • @chabdullah4805
      @chabdullah4805 5 лет назад +1

      using dev c++ is this program run in dev C++????

    • @bellamycat9800
      @bellamycat9800 5 лет назад

      CH ABDULLAH hello I don’t know

    • @rajahussainabbaxi8940
      @rajahussainabbaxi8940 4 года назад +1

      Thanks for whole code combination, so many errors can debug from your code

  • @jatinnegi6363
    @jatinnegi6363 5 лет назад +46

    you can use logical or operator
    if(j == 0 || j == width - 1)

    • @uahatoxicboi9801
      @uahatoxicboi9801 4 года назад

      @Lee Ruan can you explain to me how that line of code works. please.

    • @ryangoods7949
      @ryangoods7949 4 года назад +1

      @@uahatoxicboi9801 if j is equal to 0 or j is equal to width minus one then print #.
      Rather than making two separate if statements he made 1 statement which will print # when either of those conditions are met.
      The || means or. So that if statement will run if either condition is true

    • @uahatoxicboi9801
      @uahatoxicboi9801 4 года назад

      Ryan Goods no I meant what is j

    • @ryangoods7949
      @ryangoods7949 4 года назад +2

      @@uahatoxicboi9801 j is the variable he uses in the nested for loop because he can't use i again as it's being used in the outer loop

    • @iyad3753
      @iyad3753 4 года назад +1

      idk why but when i did this i had an extra "#" out of the box in the first and last line

  • @ridhomblr
    @ridhomblr 5 лет назад +80

    tysm man my mum is proud of me

    • @Jxhsxn
      @Jxhsxn 4 года назад +2

      You should also congradulate yourself bro you are the one behind the computer

    • @Nick-lx4fo
      @Nick-lx4fo 4 года назад +1

      @@Jxhsxn You mean just copying code from a tutorial

    • @Nick-lx4fo
      @Nick-lx4fo 4 года назад +2

      @Bima Pramudya Chill it wasn't that harsh. Anyone can copy code from a tutorial, what shows you've learned something is if you can make something yourself.

    • @mikethegamedev
      @mikethegamedev 4 года назад

      im learning C# cs

    • @jackeezz3002
      @jackeezz3002 4 года назад +1

      @Nick Right. I know but everyone starts somewhere and do you just expect ihm to just start making games with no knowledge

  • @kacperozieblowski3809
    @kacperozieblowski3809 6 лет назад +5

    Really simplified c++ to it's core. I like it

  • @JOAGOSTINI
    @JOAGOSTINI 5 лет назад +16

    At this point, in order to obtain a real square 20x20 it is necessary
    33. if (j>0 && j

    • @renaldiatma7828
      @renaldiatma7828 3 года назад +1

      ?

    • @WorstAbaYT
      @WorstAbaYT 9 месяцев назад +1

      True, looks way more optimized and less spaghetti-ish

  • @yaroslavazxM
    @yaroslavazxM 4 года назад +1

    Thanks man I finish the whole game by the end of my virtual classes.Keep up the good work.

  • @polygonerror
    @polygonerror 7 лет назад +15

    For anyone watching this, make sure that in your if statements that you use == to compare.
    if (j = 0) is setting j to 0, not checking if it is 0
    if (j == 0) checks if j's value is 0.

    • @mrcorparate
      @mrcorparate 6 лет назад

      == its the operator(equal) he is doing like when we take int i;e x=0

    • @JorisNonnast
      @JorisNonnast 6 лет назад

      Oh thanks dude you saved me :D

  • @milkyfilsen7972
    @milkyfilsen7972 3 года назад +2

    if you try to do this in newer versions , to put the constant rand you have to type after #include , #include

    • @JozzJavier
      @JozzJavier Год назад

      Thank you so much, Im having a hard time trying to figure out what am I suppose to do to make rand declared so I can compile and run it

  • @drcvagos-iu
    @drcvagos-iu 8 лет назад +7

    easy to follow, easy to understand, thank you!

  • @brianscalabrine2225
    @brianscalabrine2225 3 года назад

    I know only code basics like what a variable or constant is; how to make a calculator and stuff like that but watching this and searching up the meanings of the terms really upgraded my knowledge by a whole lot.

  • @DanielZawadzki32
    @DanielZawadzki32 5 лет назад +6

    I like simple tutorials like this. Like++

  • @juliushouston3640
    @juliushouston3640 5 лет назад +2

    Thank you for the information you provided for me. Im new to this coding and you displayed your program with eaz of my mind! I really respect what you do,and give you all the props that money cant buy! You presentation is better than many of my professors ever taught me! I will subscribe and will follow you. I would like to pay you for some 1on 1 communication, to help me out personally with my idias in the future! Thank you and be blessed

  • @breeze2440
    @breeze2440 4 года назад +3

    Loved the contents simple and straight to the point..please uploading !

  • @user-rg3kf3ty1p
    @user-rg3kf3ty1p 2 года назад +1

    Hello there :D
    I really enjoyed this tutorial man! Thanks for sharing experience.
    I just wondered are you from Serbia because you sound like that? I'm from Serbia :D

  • @martinruzhinov3348
    @martinruzhinov3348 9 лет назад +8

    Thank you! Very clearly explained. You are making good tutorials.

  • @gonzalorosario1278
    @gonzalorosario1278 4 года назад +1

    Im use to code in game maker studio, I found your tutorial very nice to a pure c++ introduction. Great Work!

  • @Flyingsandwiches-nr1zc
    @Flyingsandwiches-nr1zc 5 лет назад +3

    Wow I'm taking up game design and I have a class on c++ and it's my first time ever learning about it. It's a little hard but I understand it. I'll learn as I go.

  • @FinnishArmy
    @FinnishArmy 2 года назад

    This will be my project over thanksgiving break

  • @ruddydd4085
    @ruddydd4085 3 года назад +53

    someone still active ?feel so lonely :(

  • @newmagicfilms
    @newmagicfilms 7 лет назад

    Easy to follow, i am so noob in programming . I understood a lot and you're not boring! :)

  • @Tiogar60
    @Tiogar60 4 года назад +3

    Super well explained! Love it

  • @jithinpaulson
    @jithinpaulson 4 года назад +2

    Jst a correction.
    At lime 33 tht cout " " happens regardless of any condition so we have extra 2 blocks... so putting tht under a if else condition will fetch u an exact 20*20

  • @hademvids
    @hademvids 8 лет назад +10

    pretty cool but i keep getting the errors
    In function 'void Setup()':
    [Error] 'rand' was not declared in this scope
    PLEASE HELP MEH!

  • @MdBinAlNasr9485krdiq
    @MdBinAlNasr9485krdiq 3 года назад +2

    Sir, nice one using nested for loops and else-if statement in C++.

  • @TheBeLuvdTRex
    @TheBeLuvdTRex 8 лет назад +169

    Dude your intro is sick.

  • @everything_programming7096
    @everything_programming7096 4 года назад +1

    Loved the programming tutorial, subscribing to you my man

  • @danji9485
    @danji9485 7 лет назад +2

    Finally! A tutorial for windows AND linux.

  • @logomoniclearning6680
    @logomoniclearning6680 6 лет назад

    Youre the man NVitanovic, you deserved that subscription

  • @cloverplays1706
    @cloverplays1706 4 года назад +13

    I’m a biology student never have i ever studied about computers but i’m going to make this

    • @perrypatel79
      @perrypatel79 4 года назад +2

      Bro, Just saying but merely copying what someone is doing isn't called programming. It takes years of learning to be a programmer and it isn't easy. Don't feel bad cause my dad used to tell me this when I was small and this is what developed my interest and I took coding as a major.
      Regards
      Red Bandit

    • @cloverplays1706
      @cloverplays1706 4 года назад

      Red Bandit I’m sorry I just wanted to test it out. As you’ve said it takes years of learning and you are absolutely correct i couldn’t even understand this properly.....

    • @cloverplays1706
      @cloverplays1706 4 года назад

      Red Bandit And Good Luck with coding!

    • @AJ8800
      @AJ8800 4 года назад +4

      @@perrypatel79 ur gay

  • @informalpivots7673
    @informalpivots7673 3 года назад +1

    Done sir in Dev cpp 👍
    After fixing lots of bugs thank you ❤️

  • @thecutetimo
    @thecutetimo 7 лет назад +176

    He sounds so depressed 0:27-0:32

  • @DarisYT
    @DarisYT 5 лет назад

    Nikola, hvala na tutorijalu!

  • @Noble_1776
    @Noble_1776 7 лет назад +7

    here is a more readable version of the draw function. It is a little confusing when your syntax is inconsistent like in the video with the missing curly brackets and deleting else.. happy coding!
    void draw(){
    system("cls");
    for (int i = 0; i

  • @Mrkevi123
    @Mrkevi123 7 лет назад +1

    How do you get your window to clear and look like it has motion?
    I'm trying to build a game of connect 4 and dont want the console window to scroll for every play

  • @greenheart5334
    @greenheart5334 5 лет назад +7

    i made snake game in C++ too as programming project.

    • @safarekhawab3376
      @safarekhawab3376 3 года назад

      can you please tell me whats compiler are you using please ...I need full name

  • @dorijan3920
    @dorijan3920 4 года назад

    Proslo je skoro 5 godina ali i dalje odlican video :D

  • @SobhyShehata
    @SobhyShehata 7 лет назад +4

    great work and well explanation, thanks ;)

  • @truthvader5727
    @truthvader5727 6 лет назад +9

    Your code is flickering because of the "gameover" variable not being made true at the end. This makes your code to execute repeatedly thus clearing and printing the map forever!!

    • @SkiNNyPoNNy
      @SkiNNyPoNNy 5 лет назад +2

      obviously the code has to be repeated so you can update the position of the snake

    • @MrThienprowinn
      @MrThienprowinn 5 лет назад

      @@SkiNNyPoNNy would the code be better if you create a multidemintional array and print the # on the first and last indexes of the array ?
      int array[x][y];
      for (int i = 0; i< x; i++){
      array[0][ i ] = "#";
      array[x][ i ] = "#";
      }
      for (int i = 0; i< y; i++){
      array[0][ i ] = "#";
      array[y][ i ] = "#";
      }

  • @retrogamingbros8164
    @retrogamingbros8164 6 лет назад

    This really helped me... Now I can right the exact same code without looking or listening!

  • @teodortodorov1662
    @teodortodorov1662 3 года назад +3

    I`m learning programming for 3 years and I still like "WTF IS THAT MEAN?"

  • @DevlogBill
    @DevlogBill Год назад

    Cool video NV. I didn't know with C++ you could make a very simple game that easily. I assumed you would have over 100 lines of code to start your first very basic game. Also, are you able to make games with C as well as C++? I prefer C++ over C, C++ feels more flexible. At the moment I am taking a break from Kotlin and I am playing around with C++ to try and better understand how the language works and see if I can build a very simple but small game. I am happy I found your channel.

  • @denzellupheng7063
    @denzellupheng7063 5 лет назад +3

    Whats the difference between system(“cls”) and clrscr() ?

    • @user-bo5vr1ib6i
      @user-bo5vr1ib6i 4 года назад

      From what I could find from a quick search, clrscr() is an old function that is only included with a header file that comes with some old C compiler. Whereas system() is a C/C++ Standard function, meaning it has to be included in every compiler, and "cls" is just the console command to clear the screen.
      Apart from that, I think the functions are identical with that as an argument to system().

  • @aslanferzana6201
    @aslanferzana6201 3 года назад

    This video really help me but you have to add "include on the second line

  • @MJ-gs4co
    @MJ-gs4co 6 лет назад +11

    Ayy lmao, pretty good tutorial you know what I'm sayin. But can you do a meme programing tutorial? I need to step up my meme game ASAP.
    Thanks dude.
    Ps sick snake game bruh

  • @nadaatef3861
    @nadaatef3861 2 года назад

    Thanks for all the efforts.. I laugh each time u say We have something not good:)

  • @Minecaftundmehr2
    @Minecaftundmehr2 8 лет назад +9

    Hello,
    I have a problem.. the programm is just spamming the console with #.
    I hope I can get a fast answer.

    • @kanden6442
      @kanden6442 8 лет назад

      im having the same problem

    • @Gerpar_
      @Gerpar_ 8 лет назад +2

      had the same problem. I had i++ for one of them, when it was j++

    • @frankakn_7448
      @frankakn_7448 7 лет назад +1

      i had the same problem and fixed it by just compiling xD

    • @erengemici8419
      @erengemici8419 7 лет назад

      Which ide are you using guys ?

    • @unpluggedcovers1258
      @unpluggedcovers1258 7 лет назад

      Eren Gemici c free

  • @azurekeenanlightning
    @azurekeenanlightning 3 года назад

    I downloaded the visual studio program but when I installed it my video playback shows a black screen. What happened and what do I do??

  • @detomatorcz910
    @detomatorcz910 7 лет назад +8

    Unable to start program :( when I start Debugging

    • @detomatorcz910
      @detomatorcz910 3 года назад

      @TCP Timeouts Thanks, dude :D

    • @detomatorcz910
      @detomatorcz910 3 года назад

      @TCP Timeouts Don´t worry :D I will try it now. Thanks

  • @pafiro
    @pafiro 7 лет назад +2

    You should make a tutorial explaining what each tag means, for beginners :)

    • @pafiro
      @pafiro 7 лет назад +1

      And what the tag does and how it interacts with other tags ect

    • @AK48PL
      @AK48PL 7 лет назад

      +Pafiro There are thousands of tutorial for beginners, here you have something else

    • @pafiro
      @pafiro 7 лет назад +1

      Yea I know, just suggesting it most of the tuts I found didnt explain it very well

  • @arcanerstudios
    @arcanerstudios 7 лет назад +3

    You have not given enough intro to each line of code to make it understand what each line do.

    • @kumakanai
      @kumakanai 5 лет назад

      remind me what's google for again?

  • @sid2399
    @sid2399 6 лет назад

    Can I increase the speed of the snake to make the game a little bit tougher time by time? Say, you eat 5 fruits and the speed increases...

  • @Parth-gx1nw
    @Parth-gx1nw 3 года назад

    I'm 1st semester student.I have learned c programing basic and now I'm learning c++,here learning how to make games

  • @Andrei-mi9zn
    @Andrei-mi9zn 7 лет назад +13

    When I enter the function "fruitX = rand ()% width;" Tells me the "rand" identifier is undefined and the same as "system" ("cls");"
    can u help me ? :)

    • @thunderstormgaming9099
      @thunderstormgaming9099 7 лет назад

      Andrei same

    • @qasem9549
      @qasem9549 7 лет назад

      same

    • @sendim000
      @sendim000 7 лет назад +7

      Mine is working fine but someone below had the same problem and they were telling him to put #include ont top, hope it helps (sorry for my english)

    • @qasem9549
      @qasem9549 7 лет назад +1

      ok thx

    • @romulodurante2822
      @romulodurante2822 7 лет назад +1

      #include , this will make the "system"(cls); to work.

  • @yousefsuzuki2436
    @yousefsuzuki2436 2 года назад +2

    Yeah I entered the same codes you did but I got 2 errors
    One says “error: ‘rand’ was not declared in this scope”
    And the other says “error: ‘system’ was not declared in this scope”
    Please help and thank you

    • @hriankovacsolovy7795
      @hriankovacsolovy7795 2 года назад

      Add these two libraries:
      #include
      #include
      I had the same problem. It helped me.

  • @181Ravikiran
    @181Ravikiran 7 лет назад +23

    you can draw it by simple code to draw square :
    for(int j = 0 ; j < height ; ++j)
    {
    for(int i = 0; i < width ;++i)
    {
    if( i == 0 || i == (width - 1) || j == 0 || j == (height - 1) )
    {
    cout

    • @gameShu_Yaksha
      @gameShu_Yaksha 7 лет назад

      Thanks ! This is small and efficient code

    • @versache8247
      @versache8247 7 лет назад +2

      I know I'm 11 months late and that this might be a dumb question, but why do people prefer writing "++j" instead of "j++" in a For? j++ seems more natural to me, is anything different if you write it the other way around?

    • @ishant0wn
      @ishant0wn 7 лет назад +2

      if you write "++j" it will add 1 to j before it counts the value of j and if you write "j++" it will count the value of j then add 1 to it. In for loop it doesnt make that big of a diffrence (i think).
      So if you write this:
      int a = 0, b = 0;
      cout

    • @versache8247
      @versache8247 7 лет назад

      Oooh, I understand now! Thank you very much, I really appreciate the help!! :D

    • @Player-ub9tg
      @Player-ub9tg 6 лет назад

      mine is better :)
      #include
      using namespace std;
      int main(){
      int n,m;
      cin>>n>>m;
      for(int k=0;k

  • @grilledpikachu
    @grilledpikachu 2 года назад

    very useful project to learn C++. Thanks!

  • @TheLeontheking
    @TheLeontheking 6 лет назад +18

    unreal engine 5!!

  • @juneshgautam8655
    @juneshgautam8655 2 года назад

    I am using Xcode instead of visual studio on my mac and I encountered a problem telling "TERM environment variable not set." Can you please help me sort it out?

  • @elementalslap619
    @elementalslap619 8 лет назад +5

    I'm so confused 😫

  • @tokugeeky2931
    @tokugeeky2931 Год назад +1

    Great video, thank you. Still I tried to follow step by step but the result still looping. Not sure what I am doing wrong

  • @TheDrumergod
    @TheDrumergod 9 лет назад +6

    Amazing vídeo!!!!!

  • @georgiastefan2670
    @georgiastefan2670 4 года назад +1

    Can somebody help me please? Like when i try to run the code ( which is the same from the video) the game is not looking like in the video ( it appears and disappeara continuosly and it doesnt work moving the snake).
    Might the problem be the program? Maybe something is not good in my coding program or maybe the problem comes from my pc. ( It happens the same with code blocks and visual studio )

    • @zanomeme8041
      @zanomeme8041 4 года назад

      Do you have a sleep function somewhere that makes the redrawing delayed?

  • @mostafaebeed9749
    @mostafaebeed9749 5 лет назад +6

    instead of adding 2 to width in the loop i made it like this in the if statement:
    if (j == 0 || j == width -1)
    cout

    • @krzysztofmatuszek
      @krzysztofmatuszek 5 лет назад +1

      Well, I'm quitting my first year of studies to pursue computer science - you made me glad I also noticed this unnecessary line m8

  • @KeithTreason
    @KeithTreason 5 лет назад

    It's a pretty good tutorial but I wish you went more in-depth on what you are doing. Anyone who isn't a complete novice might disagree with me though. Can't please them all but I appreciate this regardless.

    • @KeithTreason
      @KeithTreason 5 лет назад

      @Bob Bob Yes, even complete novices get bored with the basics and would like to try something they aren't yet ready to completely understand.

  • @johnnyrod328
    @johnnyrod328 6 лет назад +6

    #include
    using namespace std;
    bool gameOver;
    const int width = 20;
    const int height = 20;
    int x,y,fruitX,fruitY,score;
    enum eDirecton {STOP = 0, LEFT , RIGHT , UP , DOWN};
    eDirecton dir;
    void Setup()
    {
    gameOver = false;
    dir = STOP;
    x = width / 2;
    y = height /2;
    fruitX = rand() % width;
    fruitY = rand() % height;
    score = 0;
    }
    void Draw()
    {
    system("cls");
    for (int i=0; i< width+2; i++)
    cout

    • @damm_coder4550
      @damm_coder4550 5 лет назад

      Actually I am doing it on code blocks the error occuring is rand()
      "It says that rand() is not declared ." Help me please.

    • @arturminiput7587
      @arturminiput7587 4 года назад

      Add to ur code #include "stdlib.h"

  • @ReleaseTopic87
    @ReleaseTopic87 5 лет назад

    Hey, I'm a really beginner in this coding, can u tell me what should I do to get to the coding section??

  • @s_h_o_k1836
    @s_h_o_k1836 6 лет назад +11

    ЙОР инглиш ис вери бед мен

    • @MichelWTH
      @MichelWTH 6 лет назад

      кала бока мано фала мелиор энтао

    • @zhizhail4711
      @zhizhail4711 5 лет назад

      ю инглиш ту вери бэд, как и мой

    • @a.rhythm9702
      @a.rhythm9702 4 года назад +1

      Your English is very bad man.......lol

  • @techwithzaitri9458
    @techwithzaitri9458 4 года назад +1

    thank you soooooooooooooooooooooooooooo much for your lesson

  • @bartoszgowacki3086
    @bartoszgowacki3086 5 лет назад

    I like that you use so simple english because my english skill is very bad but i understood like 99%

  • @jonsnow9246
    @jonsnow9246 7 лет назад

    +NVitanovic The console is flickering too much.The food and snake head are also not stable.What should I do?

  • @nebertngari6627
    @nebertngari6627 Год назад

    Hello man. The code isn't running on vs code. I have tried but it keeps showing an error at the void setup function, the x, y, fruitX,fruitY and the tails. Please help.

  • @filipkulka4979
    @filipkulka4979 2 года назад

    Hey, system("cls") is not working on my PC even thought I have recreated the code from the snake videos to the last detail. Any ideas what could be the problem?

  • @0_-
    @0_- 4 года назад

    This is the first video I saw of you!

  • @peter4722
    @peter4722 2 года назад

    Tutorial is great. How did you get rid of the text cursor? On my computer, it shows up all over the screen.

  • @NuclearBadger8
    @NuclearBadger8 6 лет назад

    i am doing this in dev c++ and all i get is constant opening of cmd windows, like they just flash rolling open for me? how can i make em stop?

  • @arshdeepsinghsidhu6298
    @arshdeepsinghsidhu6298 2 года назад +1

    how did you open this app visual Microsoft

  • @mr.caveira8043
    @mr.caveira8043 4 года назад +3

    my visual studio says that it doesn't recognize: identifier "end1" is undefined

  • @mkstyle6896
    @mkstyle6896 7 лет назад +1

    Nice. I'm trying to transition from Actionscript 2.0 and people recommended java. But i noticed that C++ could go straight to the compiler and get a better performance.

  • @YannAriell
    @YannAriell 3 года назад +1

    hi guy, is it possible to do it again but using the language C

  • @luongmaihunggia
    @luongmaihunggia 2 года назад

    You wasn't kidding when you say it "flickers a littler bit"

  • @omkarpatil2094
    @omkarpatil2094 8 лет назад

    I'm using visual studio 2010,
    I did this - File -> New file -> Visual C++ -> C++ File -> open , and I typed in the code.
    But I don't get the Run button (the tiny right-facing triangle you click), its faded out.
    HOW DO I RUN THE PROGRAM?

  • @codingworld6151
    @codingworld6151 3 года назад

    Sir! After compilation the program it shows an error that "Rand was not declared in this scope", sir please guide me.

  • @corz299
    @corz299 4 года назад +1

    how do i use the visual studio express thing?

  • @wimharris-ryden3234
    @wimharris-ryden3234 4 года назад

    prob dumb question but I cant build past the firs function put in and the log just says setup was nont declared in this scope any suggestions (side note* im using code::blocks)

  • @scribblenauts11
    @scribblenauts11 9 лет назад

    Hey my console is flickering too slow which is causing the bottom left corner to not show up and tips?

  • @Cacowninja
    @Cacowninja 6 лет назад

    What are we supposed to open the project as?
    Are we supposed to open it as a Visual c++ Win32 console application?
    I mean it won't compile and run my code so I'm trying to figure out the problem.

    • @Cacowninja
      @Cacowninja 6 лет назад

      Okay I fixed it I just had to add: #include "stdafx.h"
      To the first line of code.

  • @benderbendingrofriguez3300
    @benderbendingrofriguez3300 4 года назад

    hi NVitanovic:
    What is your background? Are you a software engineer, computer scientist? How many programming language do you know how to used?

  • @trestonbouvet3411
    @trestonbouvet3411 8 лет назад

    does this only work on visual studio because im using dev c++ and it is not running is says there is a error on line 4 & 5