LOG_DATE: [2025-06-15] | CATEGORY: SPEED_LEARNING | STATUS: COMPILED

I Learned Python in a Weekend

> CREATING_SNAKE.PY...

Coding is the modern wizardry. I wanted to see if a complete muggle (me) could cast a spell (make a game) in 48 hours.

Goal: Recreate the Nokia classic "Snake" using Python.

Tools: Python 3, Pygame, VS Code, ChatGPT (for debugging).

Saturday Morning: The Setup Hell

The hardest part of coding isn't the code. It's the setup.

"Pip is not recognized as an internal or external command."

I spent 4 hours just trying to get `pygame` to install. I felt like throwing my laptop. Welcome to engineering.

Saturday Evening: The Moving Box

I finally got a black window to open. I drew a white square.

import pygame
pygame.init()
screen = pygame.display.set_mode((600, 400))
# It lives!

When I made the square move when I pressed 'Right', I felt a surge of god-like power. I control the pixels!

Sunday: The Logic

Snake is deceptively hard. You have to:

  • Track the snake's body (a list of coordinates).
  • Move the tail to where the head was.
  • Detect collision with the wall (Death).
  • Detect collision with food (Growth).

The Bug: For 3 hours, my snake kept growing infinitely without eating food. It was terrifying. The Infinite Snake.

The Result

[ SNAKE GAME RUNNING ]
SCORE: 15
***O-----

It works. It's ugly, it crashes if you press two buttons at once, but it works.

Conclusion

Coding is 10% writing cool logic and 90% Googling "Why is my variable undefined". But seeing that snake move because I told it to was the most satisfying creative experience I've had in years.