mathspp
  • Blog
    • Pydon'ts
    • Problems
    • TIL
    • Twitter threads
  • Books
  • Talks
  • Trainings
    • Advanced iteration
    • Python for scripting and automation
    • Rust for Python developers
  • Courses
  • About
Link blog

Animation vs. Coding - YouTube

by Alan Becker on 19-03-2025 20:50

In this brilliant video, Alan Becker shows us a world where a stick figure fights a computer through programming. I can't do a great job at explaining what's happening other than the fact that the two characters are fighting and writing Python code to use as weapons and to manipulate the arena...

What I enjoyed the most was the attention to detail and the fact that we were shown the code and the code matched the animations quite faithfully. For example, at one point, the computer creates a “weapon” that “fires” letters from the alphabet:

import string as ammo
gun = list(ammo.ascii_uppercase)
print(gun.pop())

As the animation progresses and gun.pop() keeps getting called, you see the alphabet being fired back to front, and once the letter A is fired, the gun is empty and you hear the click of a gun without ammo. Just wonderful!

Previous link Next link

The 2 hardest problems in programming are naming, cache invalidation, and off-by-one errors.

mathspp
  • Blog
    • Pydon'ts
    • Problems
    • TIL
    • Twitter threads
  • Books
  • Talks
  • Trainings
    • Advanced iteration
    • Python for scripting and automation
    • Rust for Python developers
  • Courses
  • About