Snake Game In Python - Python Beginner Tutorial

preview_player
Показать описание
Implement the famous Snake game in this beginner tutorial! Learn also how to use the curses module to build terminal applications. This tutorial is aimed at beginners. You will learn about different data structures (e.g. lists and tuples) and how to implement the game logic with different control flows (e.g. while loop / if-statements).

~~~~~~~~~~~~~~ GREAT PLUGINS FOR YOUR CODE EDITOR ~~~~~~~~~~~~~~

Get my Free NumPy Handbook:

📓 ML Notebooks available on Patreon:

If you enjoyed this video, please subscribe to the channel:

You can find the code here:

Curses doc:

Original Code:

~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

# Python

----------------------------------------------------------------------------------------------------------
* This is a sponsored or an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏
Рекомендации по теме
Комментарии
Автор

Currently searching for Snake Game Tutorial in Python, and unexpectedly saw this newly uploaded!

emeraldscripter
Автор

Nice tutorial with interesting links (such as adding a SPACE-bar to pause/resuming game, or, an enemy). Thanks for posting, and no problems with the code.

flashypepo
Автор

Thanks this is what I wanted to do with python and I just needed to start with something easy

codinginthesaddle
Автор

This was less of a "Tutorial", more of a "watch me type this code".. there were some common errors that could've been made, such as importing curses for me, which doesn't come with windows python, as well as the fact you can't run this with your IDE, you have to use the terminal, and if the terminal isn't opened to a proper size then you'll get errors. There was also no in-depth explanation of the logic

mitchellbergman
Автор

minute 16:35, you can do this:
if y in [0, 19]:
break
if x in [0, 59]:
break

PaoloAuletta
Автор

If you are on windows and using pycharm. You need to install courses manually. You need to manually adjust the 'Terminal' size for the curses window.

Jachoos
Автор

I got this error File "c:/Users/hp/Desktop/Snake game.py", line 19
print(f''Final score = {score}'')
^

hython
Автор

🤝 perfect video waiting for pyt🔥rch to control this snake

saurrav
Автор

I didnt understand anything but also it is fabulous

sanjayrajesh
Автор

bro is professor poopypants from captain underpants lol good video

officialchimez
Автор

Very nice video for me to kill time while lock down at home!

stansuen
Автор

very cool! thanks for the tutorial. I have liked and subed

ilyab.
Автор

*I used the python to create the python*

BiassedYT
Автор

Would you consider making a tutorial on how to use tensorflow to create an ml program that can play snake?

shopveilad
Автор

thanks for sharing! I understand this is much simplified for the tutorial purpose. but just want to point out that food loop gives me so much cringe.

yamatowolfgang
Автор

Very nice tutorial. Just a question. In the while key != ESC loop, why we only draw snake's head, win.addch(snake[0][0], snake[0][1], '*'? Why not draw the rest of snake body? It seems works fine.

kaiye
Автор

Sick, thanks for the tutorial. Will improve the code a little myself tho :D

HeinEmil
Автор

To be honest this helped me a lot thanks keep it up

exe
Автор

hey, ive tried following your tutorial step by step, and it worked fine, but the code dosent detect any keys, if its the arrows or if its ESC.
i even tried copy pasting your code, and it didnt work as well.
im using Pycharm on Windows 10 Pro, how can i fix this?

refaelnesterov
Автор

This tutorial really need to be updated, I do agree with @Mithchell Bergman, this video seem catered to get more views then actually teaching about python.

tuffhazard