High Definition Standard Definition Theater
Video id : Cp-Cf9mssd8
ImmersiveAmbientModecolor: #dcc8c8 (color 2)
Video Format : (720p) openh264 ( https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz
Audio Format: 140 ( High )
PokeEncryptID: 2e8505ba194898a6e83563b12f168f247d4feec5b9fb9b065bd9e726f67783258216cb0a037270b0dd503eac21cb3295
Proxy : eu-proxy.poketube.fun - refresh the page to change the proxy location
Date : 1732576483599 - unknown on Apple WebKit
Mystery text : Q3AtQ2Y5bXNzZDggaSAgbG92ICB1IGV1LXByb3h5LnBva2V0dWJlLmZ1bg==
143 : true
Snake Game in 20 Lines with Python | Pygame |
 60 FPS video
169,207 Views โ€ข Mar 7, 2022 โ€ข Click to toggle off description
The Snake game in 20 lines (!!!) of code in the Python programming language using the Pygame graphics library. Math magic!

Pygame is a convenient and simple library for displaying graphical information, for creating simple games, perfect for beginners to program in Python.
To install Pygame, type in a terminal and press Enter: "pip install pygame" (no quotes)

#coderspace
#shorts
#python
#snakegame
#pythonpygame
Metadata And Engagement

Views : 169,207
Genre: Education
License: Standard YouTube License
Uploaded At Mar 7, 2022 ^^


warning: returnyoutubedislikes may not be accurate, this is just an estiment ehe :3
Rating : 4.943 (102/7,037 LTDR)

98.57% of the users lieked the video!!
1.43% of the users dislieked the video!!
User score: 97.85- Overwhelmingly Positive

RYD date created : 2024-10-27T16:03:51.887794Z
See in json
Connections
Nyo connections found on the description ;_; report an issue lol

165 Comments

Top Comments of this video!! :3

@Balyanedits001

5 months ago

meanwhile me : "hello world"

50 |

@idontknow4160

2 years ago

WOAH THIS IS CRAZY, as a fellow wanabe programer, i can berly make pong with 20000000000000000000000 lines of code so good job

299 |

@drdonk_auf_die_1_xd

1 year ago

Readability left the chat

170 |

@duksonmitch

1 year ago

BRO THIS IS SO IMPRESSIVE GOOD JOB!!!

6 |

@naazeri

2 years ago

woooooow ๐Ÿ˜๐Ÿ˜ I'm fall in love with pygame and pyth

11 |

@kazuya4km

2 years ago

It took me 137 lines of code ๐Ÿ˜ญ

18 |

@DaioMusic

2 years ago

Nobody cares about that apple not being randomly generated? Itโ€™s always generated at the end of the snakeโ€ฆbut yeah, still cool ๐Ÿ˜

112 |

@alexdemeter1558

1 year ago

import pygame as pg

y, step, head = segments = [15, 16, 17]
n, apple = step, 99
screen_full = pg.display.set_mode([225] * 2, pg SCALED).fill

while segments.count(head) % 2 * head % n * (head & 240):
if e := pg.event.get(768):
step = (e[0].key % 4 * 17 + 15) % 49 - n
segments = segments[apple := head] + [head + step]

screen_fill('black')
if apple == head:
apple = segments[0]
for i, v in enumerate([apple] + segments):
screen_fill('green' if i else 'red',
((v - 1)) % n * y, (v - n) // n * y, y, y))
pg.display.flip()
head+= step
pg.time.wait(100)



That's the code if u want to copy and past and makes eser to copy if u can't copy and past

Also happy new year

145 |

@knut-olaihelgesen3608

6 months ago

Nice use of the tuple packing/unpacking

|

@letsplaynwatch3774

1 year ago

What are the controls to control the snake

12 |

@JEGANMAYIL

1 year ago

Thank you bro I am complete my assignment thanks ๐Ÿ™๐Ÿ™

|

@sunset.16020

1 year ago

I ran it and it looked okay but only stayed for about 6 seconds do you have any explanation for this

4 |

@qert08

2 years ago

What applications needed?

9 |

@everythingwithmalak1123

1 year ago

i have one simple questions
how do you open the game what is shortcut that you click in the keyboard .
i appreciate your help guys thank you

3 |

@Theguywhoreallyjustrhymed

2 years ago

Mine opens then closes again

10 |

@ray2dasherthedragon336

1 year ago

I wish youtube shorts didn't have to cut the sides of the screen...

2 |

@Jacknoham

1 year ago

Mine only goes down the first 2 spaces

1 |

@Sleepsnore

3 months ago

Cool, now make it in 1 line๐Ÿ˜‚ (Python doesn't work like that... but can it?

|

@TheTrendyGamer-sh4dv

3 months ago

damn it actually worked

|

@VansG

4 months ago

And then there is me writing it in 150 lines

|

Go To Top