The same race — but the speed and accuracy are worked out in Python
← Back to Fun TimeRace on the everyday words, or practise a Classical Roots lesson. Pick one book, then tick as many lessons as you like.
There is almost no JavaScript on this page. The browser downloaded Pyodide — a complete Python interpreter compiled to WebAssembly — and then ran the .py files in funtime/pylib/. Python does the rules, the maths and the drawing.
| File | What it does | Good functions to try re-writing |
|---|---|---|
| pylib/typing_rules.py | The rules: matching letters and working out the speed | matching_letters, submit_word, accuracy, words_per_minute |
| pylib/typing_draw.py | Painting the page — Python calling the canvas | layout_words, draw_typed, render_game |
| pylib/typing_web.py | The glue: the keyboard and the on-screen one | do_action, on_hidden_input, frame |
🔍 Compare the two versions. Open lib/typing-rules.js and pylib/typing_rules.py side by side — same ideas, two languages.
🛠️ Build it yourself: Build Typing Race in Python walks you through the functions one at a time.
⚠️ If the game never starts: the page has to read its .py files, which a browser will not do for a page opened straight off your disk. Use the live site, or run python3 -m http.server in the project folder.