helo!! continuing from last time — taskEngine.js is done, and lobby/live-race is actually talking to firebase properly now too. this is it, the project’s finished!!
taskEngine.js works backwards instead of using hardcoded rules like the old 25-rule version did: it builds a random hidden “reference solution” first (variable names, numbers, strings, a list), then derives every rule from a real fact about that solution — its actual sum, its actual length, whether one number happens to be prime, etc. since every rule comes from the same solution, they can never contradict each other no matter how many stack together. difficulty just controls how many rules get pulled from the pool (1 easy / 3 medium / 5 hard), and it keeps a history per difficulty so the same combo won’t repeat until the pool’s exhausted.
wiring it all together turned up a bunch of small but annoying bugs, mostly not taskEngine’s fault directly:
- two separate filename casing mismatches (taskEngine.js and firebaseClient.js) — the script tags in index.html didn’t match the actual filenames on disk exactly, fine on windows locally but the dev server (and github pages) treat urls as case-sensitive, so both files were silently 404ing and breaking everything downstream
- config.js had the firebase config saved under the wrong variable name, so firebase never actually initialized and threw a reference error instead
- the join-a-room screen was stacking the code input + join button on top of the waiting room instead of hiding them after a successful join, looked broken even when it technically wasn’t
- rooms never got cleaned up in firestore after cancelling out of one, so an old room code could still say “already started” if you landed on it again later — fixed leaveRoom so the host actually deletes the room on the way out now
singleplayer, hosting/joining rooms, live races, the leaderboard, streaks, and the tutorial all work end to end now. and it’s ready to be shipped!!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.