The silly game code is available on GitHub: github.com/carmensantos/snake-game Code CSJackie15 for 15% off Code Chrysalis' immersive coding course in Japan 🤩 p.s. please don't show this code to my boss
"Please, don't show this code to my boss." It would be worthwhile to rewrite this code in an object-oriented manner in the next episodes - it would be a great learning experience for the viewers and good material for a video or several videos.
You are novice , you video Is shit , the people saw the video , because you are women but your proyect Is Boring, Is Easy , a child the 5 Years able make the same proyect
I've been trying to learn coding and I wanted to program a snake game, but unfortunately when I use pre-built shared libraries from internet, it becomes a frog game :)
1:34 You clearly haven't seen the spaghetti I'm able to produce in Java. Spaghetti code knows no boundaries; it transcends design patterns and exists in a higher dimension than we can never possibly understand.
In a weird way, Snake is a good starting point to think about common data structures. How do you represent it? A double linked list is the easiest (add new position to head and pop last position at the tail, skip the second step when eating a fruit). But it's not an efficient structure (chasing pointers to find the next element can be slow). An array would be better, but then you'd have to grow (possibly reallocate and copy) and shift (copying everything by one position). A ring buffer would be perfect, but they usually aren't meant to grow. It could be a fun exercise to see how much you can "over engineer" the problem for best performance (which is of course very silly and pointless for a Snake game, but something AAA devs will have to worry about).
always nice to do snake in some language. Awesome that you made us watch you doing it. And im Happy that it's same "struggle" on you side as it was on mine, it's always good to do a little thing outside the box of the normal "work" related programming work. Nice video.
I was born in 1963, so I was taught nothing whatsoever about computing at school . And only very superficially in Fortran at Uni. I am lost, watching this video, Jackie! But impressed.
This is great Thank you :) it really helps to see a professional going through the same process of finding mistakes, debugging etc and sticking at it until they get the project where they want it. It inspires me to keep going/learning when I get stuck on my owm stuff
Awesome Video! Really clever how you coded this Snake Game with another kind of snake! ;) Thank you so much for featuring us in the video, we look forward to working with you 🤝 Keep up the good work 💪
This is what I was looking for months! Just a ''code with me'' with simple exercises like a snake game! Please do more since since this helps so much people who wanna start coding but are stuck on the ''tutorial lane'''. What we are missing are projects and 'code with me' is perfect! Are you thinking about making a series of this? (Already Subscribed)
Fun evening project, thanks for sharing! I was just looking at your generate_starting_position() function and I think the reason your snake and target were originally appearing offscreen is because you aren't taking Y into account. You're creating a position_range based on screen width (1280), then returning both a random X and Y coordinate that are based on the screen_width pixels. This is causing you get sometimes land outside the height which is only 720 pixels. A quick change to turn position_range into position_range_x and then create position_range_y based on screen_height. Then be sure to use both position_range_x and position_range_y in the return. Not sure if UA-cam will format this weird or not, trying anyway: def generate_starting_position(): position_range_x = (pixel_width // 2, screen_width - pixel_width // 2, pixel_width) position_range_y = (pixel_width // 2, screen_height - pixel_width // 2, pixel_width) return [random.randrange(*position_range_x), random.randrange(*position_range_y)]
I joined uni in London at 34, now doing my 2nd year of Computer Science. I just wish they were focusing more on practicing the actual useful skills and not just writing report, reference, academic style bla bla. You making some cool videos, giving me some ideas to be more efficient!
from what i remember about programming the delay from your keyboard to the snake (where it feels like it's not responsive) it's probably from your tick rate ..clock.tick(10) ..as it's not polling the keyboard as often. 60 would feel more responsive but you would obviously have to find another way to slow down your snake. I could totally be wrong but that's what my instinct tells me it is :)
Great upload! I'm definitely sending this to Matthew Berman.. he's gonna love it. He literally tested about 20 different LLMs, instructing them to create a simple snake game in py... and AI is still trying to get it right... lol.
The thing that got me out of spaghetti code is Uncle Bob's - Clean Code lessons. Also I am a software engineer (well DevSecOps and automation) but I can't wait to spend the evenings coding games in Unity and watching programming videos like this. I'd love to see if someone checks out this code and adds sprites, I'm curious to see them in pygame.
I expected to see usage of Sliding window algorithm for the snake cause it fits here perfectly. But that is a bit more advanced approach for this video.
Oh that's funny. "I won't do object-oriented, I will do spahetti-code instead". There is a huge world of procedural programming, some years back it was the way to write code. Procedural code is still a big part of your operating system. Not being object-oriented is not inherently bad, it's a completely normal way of doing things done
Yeah, I took that as a personal attack when she said that 😆 OO is 90% of the time doodoo. A blend of procedural and functional is the way to go with sooo many scenarios. I can’t remember the last time I wrote OO, probably did a little bit right out of college, but that’s about it.
11 місяців тому+2
Jackie, weird question but where did you get your vest/sweater? My wife has always cold hands and this looks like half the solution of a sweater and hardwarmer in one 😆. Your content is very relaxing, keep it up 👍
Thank you so much! This one is from Amazon but I have a similar one from lululemon which also has the thumb slots lol 😄 the lululemon define jacket is amazing you can have a look!
One thing you wished to do is HTML CSS animating, because you know how easy is to move absolute square inline-block with arrows changing the x,y value as modern react/angular renders website not having to reload it or save and preload reinstalled graphics driver. Can build it, but from my experience I know must have that Laravel/symfony/.net core framework and don't spend your time on easy tasks already build by everybody else, which every empty youtube channel is obviously not and I can't paly it on fb.
as i work a lot doing hard stuffs like automations, softwares and things like this, when i reach at home i can´t even think about programming, i need plays video games
The game is delayed in responding to your keyboard inputs because you lowered the framerate of your main loop to 10 FPS. If a keystroke happens between frames, the loop doesn't catch it. Instead, I would recommend setting the framerate back to 60 and limit the speed of your snake a different way, like only moving it once every 3 frames, for example. You can use a variable to modify the speed, which you would want to do if you plan to accommodate multiple difficulties.
amazing video ...plz continue and can you advice me what should i learn next i have just finished learning all python sntax and now i feel can not create this py game by my self ..plz tell me and thank you
I feel like the input issue is caused by the low frame rate. You could try and increase the frame rate to 60 again but create a simple timer to tell the snake when it can move.
Hi Jackie great video I'm starting coding, I have a question recently I bought a ultrawide monitor like yours and I would like to know the dimensions of your desk in order to have a good workspace. Thanks in advance!
My PowerShell scripts always look like spaghetti on reflection and I can seldom read them after a few weeks, it's the human way I'm sure. I wonder if you could take your code and put it through chatgpt and ask it to make it look pretty, would it still work after is the question...I must try it?
I like these coding videos! Also I like how your genuine I your posts. Quick 2 questions: what’s your thoughts on SwiftUi? Is m1 MacBook Air a good upgrade and can code on it? (Using pro 2015 currently)
Great video . Can you put your gear info into your profile? I like your keyboard better than the one who came with my iMac. For coding, it's not the best. Thanks!
I guess you've also generated a random position to put your Camera View on the center of code :) Why you did not put on right top or bottom corner where there will be no any code ?
The silly game code is available on GitHub: github.com/carmensantos/snake-game
Code CSJackie15 for 15% off Code Chrysalis' immersive coding course in Japan 🤩
p.s. please don't show this code to my boss
"Please, don't show this code to my boss." It would be worthwhile to rewrite this code in an object-oriented manner in the next episodes - it would be a great learning experience for the viewers and good material for a video or several videos.
You are novice , you video Is shit , the people saw the video , because you are women but your proyect Is Boring, Is Easy , a child the 5 Years able make the same proyect
You proyect Is shixt
You proyect Is boring
I've been trying to learn coding and I wanted to program a snake game, but unfortunately when I use pre-built shared libraries from internet, it becomes a frog game :)
1:34 You clearly haven't seen the spaghetti I'm able to produce in Java. Spaghetti code knows no boundaries; it transcends design patterns and exists in a higher dimension than we can never possibly understand.
i laughed out loud at your comment
i loved watching you solve the problems and being happy when something works.
It's really nice watching you doing some coding just for fun! I enjoyed the way you went through the problems since that is actual coding.
In a weird way, Snake is a good starting point to think about common data structures. How do you represent it? A double linked list is the easiest (add new position to head and pop last position at the tail, skip the second step when eating a fruit). But it's not an efficient structure (chasing pointers to find the next element can be slow). An array would be better, but then you'd have to grow (possibly reallocate and copy) and shift (copying everything by one position). A ring buffer would be perfect, but they usually aren't meant to grow. It could be a fun exercise to see how much you can "over engineer" the problem for best performance (which is of course very silly and pointless for a Snake game, but something AAA devs will have to worry about).
Dude you're the coolest tutor I've got! The way you're explaining makes so much more easier at least for my understanding.♥
Awesome, thank you so much!
always nice to do snake in some language. Awesome that you made us watch you doing it. And im Happy that it's same "struggle" on you side as it was on mine, it's always good to do a little thing outside the box of the normal "work" related programming work. Nice video.
haha for sure! thank you so much :)
I was born in 1963, so I was taught nothing whatsoever about computing at school . And only very superficially in Fortran at Uni.
I am lost, watching this video, Jackie! But impressed.
This is great Thank you :) it really helps to see a professional going through the same process of finding mistakes, debugging etc and sticking at it until they get the project where they want it. It inspires me to keep going/learning when I get stuck on my owm stuff
thank you so much :)
@CSJackie PS It would also be great to see how you approached this OO in python too, as a comparison
Awesome Video!
Really clever how you coded this Snake Game with another kind of snake! ;)
Thank you so much for featuring us in the video, we look forward to working with you 🤝
Keep up the good work 💪
Welcome back, MISSED YOU SOOOO MUCH😘
🥹 I missed you guys
Well done. I find it humbling to realize that I put in all of the errors in my code.
This is what I was looking for months! Just a ''code with me'' with simple exercises like a snake game! Please do more since since this helps so much people who wanna start coding but are stuck on the ''tutorial lane'''. What we are missing are projects and 'code with me' is perfect! Are you thinking about making a series of this? (Already Subscribed)
Thank you! Yes? the next one will be tic tac toe 🥹
Yes*
this video is so wholesome 😂
thank you
Fun evening project, thanks for sharing! I was just looking at your generate_starting_position() function and I think the reason your snake and target were originally appearing offscreen is because you aren't taking Y into account. You're creating a position_range based on screen width (1280), then returning both a random X and Y coordinate that are based on the screen_width pixels. This is causing you get sometimes land outside the height which is only 720 pixels. A quick change to turn position_range into position_range_x and then create position_range_y based on screen_height. Then be sure to use both position_range_x and position_range_y in the return. Not sure if UA-cam will format this weird or not, trying anyway:
def generate_starting_position():
position_range_x = (pixel_width // 2, screen_width - pixel_width // 2, pixel_width)
position_range_y = (pixel_width // 2, screen_height - pixel_width // 2, pixel_width)
return [random.randrange(*position_range_x), random.randrange(*position_range_y)]
you're coding skills are really good really looking forward for more of youre videos
I don't have idea what you're talking about but I'll watch and listen
I feel the same!
🤣
Hey Jackie, Going to watch all your content! just finished my course of basic python and hope to get as good as you.
greetz
Ricardo
Glad you made it through Amazon video layoffs. Go Jackie! Another relaxing video, thanks!
I don’t know yet (European laws delay the process) so please pray for me 😃
Loved learning this and coding along. I also love your random trail of thoughts ♥
Hello my best instructor. Congratulations on this incredible tutorial!
I joined uni in London at 34, now doing my 2nd year of Computer Science. I just wish they were focusing more on practicing the actual useful skills and not just writing report, reference, academic style bla bla.
You making some cool videos, giving me some ideas to be more efficient!
Coding is the best plan for a saturday evening! Period.
Thanks so much, I used this to get refreshed back into python, appreciated!
thank you for sharing your knowlage. It is amazing to see how the time is chaning. So thank you for sharing your knowlage with all other people.
why you look so beautiful when wearing glasses?🥹
Edited :- Your coding thinking is so good btw great video ❤️
loved this problem solving challenge
Seeing the result of your work in front of you is amazing
Nice work
Please do more of this stuff... it helps me so much
from what i remember about programming the delay from your keyboard to the snake (where it feels like it's not responsive) it's probably from your tick rate ..clock.tick(10) ..as it's not polling the keyboard as often. 60 would feel more responsive but you would obviously have to find another way to slow down your snake. I could totally be wrong but that's what my instinct tells me it is :)
Great upload! I'm definitely sending this to Matthew Berman.. he's gonna love it. He literally tested about 20 different LLMs, instructing them to create a simple snake game in py... and AI is still trying to get it right... lol.
The thing that got me out of spaghetti code is Uncle Bob's - Clean Code lessons. Also I am a software engineer (well DevSecOps and automation) but I can't wait to spend the evenings coding games in Unity and watching programming videos like this. I'd love to see if someone checks out this code and adds sprites, I'm curious to see them in pygame.
thank you for the introduction to pygame
I can remember, did this a my first university project, ASCII snake in the terminal haha, lots of fun :D
it's so fun!! my comp sci colleagues said they also coded this at uni haha
Lol, I also coded snake in the terminal with C++ and I uploaded a video on my channel
I expected to see usage of Sliding window algorithm for the snake cause it fits here perfectly. But that is a bit more advanced approach for this video.
Very Nice. Good Work and this is the beginning.
I don't know why coding looks so HOT
People like you make me fall in love with Programming ❤
Thank you so much ❤
Very Nice and Helpful Tutorial. Thank You
Haha, I tried to program this game 35 years ago in Turbo Pascal.
😭 👑
Oh that's funny. "I won't do object-oriented, I will do spahetti-code instead". There is a huge world of procedural programming, some years back it was the way to write code. Procedural code is still a big part of your operating system. Not being object-oriented is not inherently bad, it's a completely normal way of doing things done
yes I like your point of view!
@@CSJackieit’s a fact not just a pov, it’s how things work….
Yeah, I took that as a personal attack when she said that 😆 OO is 90% of the time doodoo. A blend of procedural and functional is the way to go with sooo many scenarios. I can’t remember the last time I wrote OO, probably did a little bit right out of college, but that’s about it.
Jackie, weird question but where did you get your vest/sweater? My wife has always cold hands and this looks like half the solution of a sweater and hardwarmer in one 😆. Your content is very relaxing, keep it up 👍
Thank you so much! This one is from Amazon but I have a similar one from lululemon which also has the thumb slots lol 😄 the lululemon define jacket is amazing you can have a look!
Great vid Jackie 🩵
Thank you 🥹
One thing you wished to do is HTML CSS animating, because you know how easy is to move absolute square inline-block with arrows changing the x,y value as modern react/angular renders website not having to reload it or save and preload reinstalled graphics driver. Can build it, but from my experience I know must have that Laravel/symfony/.net core framework and don't spend your time on easy tasks already build by everybody else, which every empty youtube channel is obviously not and I can't paly it on fb.
Oh greate usefull video we miss uh and pls try to upload video daily lot's of ❤😊
Thank you so much!
14:41 is the face i make when something really simple that is not working for me 😂😂😂
Sudoku or Chess might be a good challenge by the way
haha we're the same. oh my, challenge accepted! :D
Hello, I'm new in pyhton developing... in the video 1:01 in that time you installed oygame module can you clearfy it! please!!!
I Loved You~r Desktop monitor 🤩
I Not engineer but loveed your content
I didn't like seeing Procedural programming used, but I thought the result and the programmer were really beautiful.
Not a huge fan of Python but your problem solving skills are on P O I N T.
Keyboard giving really good ASMR
You are a pretty good teacher like a lecturer, I love you so much !!
As a dev with 10+ yr experience, I'd like to just say thank you.
thank you for watching! :)
@@CSJackie it is suddenly way more relaxing to watch someone else code, especially when they do it nicely :)
Snake game actually goes back much farther than the Nokia.. it came out in the late 70s for simple home computers..
Hey Jackie, you plan to do more videos like this one? For example showing some backend or full stack?
If that’s what you guys want, then absolutely 😊 I did a few in the past
You are a good programmer 💜
What font do you use in VS Code? It looks very neat and clear
11:22 ASMR segment 🚶🏼♀️🥤🫧
as i work a lot doing hard stuffs like automations, softwares and things like this, when i reach at home i can´t even think about programming, i need plays video games
The game is delayed in responding to your keyboard inputs because you lowered the framerate of your main loop to 10 FPS. If a keystroke happens between frames, the loop doesn't catch it. Instead, I would recommend setting the framerate back to 60 and limit the speed of your snake a different way, like only moving it once every 3 frames, for example. You can use a variable to modify the speed, which you would want to do if you plan to accommodate multiple difficulties.
Ah makes sense, thanks so much!!
Look who I found because of UA-cam 🎉, and as a student of CS, I’m doing my thesis about a Web app😊
Love it!!!!!!!!!! Sooooo Beautifulll...Code....
Thank you!!
I really love this video
python is so cool! good video, greetings 🙂
amazing video ...plz continue and can you advice me what should i learn next i have just finished learning all python sntax and now i feel can not create this py game by my self ..plz tell me and thank you
I feel like the input issue is caused by the low frame rate. You could try and increase the frame rate to 60 again but create a simple timer to tell the snake when it can move.
Yes I think that would be a great way of handling this!
very cool video 💯
This video is awesome.
Thank you 🥹
Do you have any python tutorial for beginners? I would love to see that.
Hi Jackie great video I'm starting coding, I have a question recently I bought a ultrawide monitor like yours and I would like to know the dimensions of your desk in order to have a good workspace. Thanks in advance!
Well, I played Tetris for the most part.
I'll try that one next!!
When is the iterm2 setup releasing??
nice video. good job
Thanks! :)
Maestro!
😂🫶
What keyboard and switches are you using?
My PowerShell scripts always look like spaghetti on reflection and I can seldom read them after a few weeks, it's the human way I'm sure. I wonder if you could take your code and put it through chatgpt and ask it to make it look pretty, would it still work after is the question...I must try it?
I like these coding videos! Also I like how your genuine I your posts.
Quick 2 questions: what’s your thoughts on SwiftUi?
Is m1 MacBook Air a good upgrade and can code on it? (Using pro 2015 currently)
This video is incredible! What theme do you use?
thank you so much!!
thank you
This was so cool. The joy at 12:55 :) How long did it take?
Which IDE do you use . Please reply,
Love from India ❤❤
i realy like it and please can u do more project video
im in love with you after watching this video
can u upload that game to your website for download
Great video . Can you put your gear info into your profile? I like your keyboard better than the one who came with my iMac. For coding, it's not the best. Thanks!
how many month did you take to learn coding ?
Thank you so much 🙂❤
Do you have a C++ version?
Even the simple games can take hours to code :D
I guess you've also generated a random position to put your Camera View on the center of code :) Why you did not put on right top or bottom corner where there will be no any code ?
Which IDE did you use
for how much time do you own that chinesse chair,is it good,does it worth the money?
Is that fleet you're using ?
You are well done
A file with 600 lines of code? I have seen functions with 800 lines of code in files with >3k lines. Oh no comments nor docstrings. That was hardcore
no problem. chatgpt please refactor lol
I am doing that in java and swing 🙂.
That's cool! Btw, can you share what brand of keyboard you have? It's cute. Haha.
It’s Royal Kludge ☺️
@@CSJackie Thank you. ☺
yes i know this game, ikd enought
Great video with a great coding and inspirational content.following you so long .can you code a saas website?
i am a mechanical engineer
how can i learn python and get benefit from it?
can you guide?
please tell me what kind of computer mouse is this