In Parts 1, 2, & 3 we have put together everything, it would seem, besides the actual game. But now we come to the point. The first set of changes we need to make involve the snake. Instead of a single dot variable, we'll need a snake list. We'll also introduce a variable to allow the snake to grow. First, modify this line: dot = pygame.Vector2(W / 2, H / 2) to snake = [pygame.Vector2(W / 2, H /
We’ve spent a week building, where we predefined every single step. But what if you don't know the steps in advance? What if the AI needs to decide whether to search Google, check a database, or use a calculator based on the user's question? This is where we move from "Chains" to Agents. If a Chain is a fixed railroad track, an Agent is a self-driving car. It has a destination (your goal) and a se
Weekly Challenge 371 Each week Mohammad S. Anwar sends out The Weekly Challenge, a chance for all of us to come up with solutions to two weekly tasks. My solutions are written in Python first, and then converted to Perl. Unless otherwise stated, Copilot (and other AI tools) have NOT been used to generate the solution. It's a great way for us all to practice some coding. Challenge, My solutions Y
LLM Foundry finally stops being a toy and starts acting like a system I wanted to see whether a weak local model could be made genuinely more useful without pretending the base model was magic. So I wrapped a small Hugging Face model in LLM Foundry, gave it memory, semantic retrieval, a reflection loop, and a benchmark harness — then made it explain why semantic retrieval matters, while the term
Every device you own has a speaker and a microphone. I decided to use them for something useful. Natural disasters knock out cell towers. WiFi dies at conferences. Underground sensors need to offload data where nothing reaches. Bluetooth pairing is painful and range-limited. LoRa is great but requires hardware you don't have. Sound doesn't care about any of that. Every phone, every laptop, every e
Most symbolic systems rely on multiple primitives. Addition, multiplication, exponentials, logarithms — each plays a different role in structuring expressions. But what happens if you force everything through a single operator? This idea becomes concrete with the EML operator: eml(x, y) = exp(x) − ln(y) In theory, this operator can express all elementary functions. But theory doesn’t tell us what
California just announced it'll start ticketing driverless cars that break traffic laws. That got me thinking — not about self-driving cars specifically, but about a problem I've hit on three different projects: how do you make an automated system respect a set of rules that change over time? Whether you're building a CI/CD pipeline that enforces deployment policies, an API gateway with rate-limit
The winter in Hangzhou is miserably damp. At 1:47 AM, I was jolted awake by an alert SMS — “User profile page returning mixed values, user A is seeing user B’s orders.” My gut told me it was cache corruption again. After digging around for a while, I found that the invalidation logic between the local lru_cache and Redis had missed a single delete in one branch. I had to manually run dozens of tes