Every function running in that game is Python you wrote yourself, and it is running inside your browser. No installing, no setup โ just Python.
Play the finished version at ๐ Snake in Python, or open funtime/pylib/ and read the rest of the code.
Now compare: you have written the same twelve functions in JavaScript and in Python. Which language said each idea more clearly? That question is what senior engineers argue about all day. ๐
๐ฎ The game so far
โฆ
๐ How this works
Each step asks for one function from the real game. The INPUT / OUTPUT / ALGORITHM comment at the top of the editor tells you everything you need โ and there is a copy above it you can open any time.
Press โถ Test it to run real checks on your function. Every โ tells you what it expected and what it got.
When all the tests pass, the next step unlocks and the demo switches to your code.
Use ๐ฌ The goal any time to see what the demo should look like when it works.
Your code is saved in this browser, so you can close the page and come back later.
๐ Your code is run by real Python (Pyodide), inside the game's own module โ so your function truly replaces ours.
โ ๏ธ A loop that never stops is caught after 2 seconds and reported as a mistake โ so you can fix it instead of reloading.