The Variable Game
- 7 Devlogs
- 16 Total hours
a browser puzzle where you write python-like code to satisfy rules before a timer deletes it — solo or racing friends live
a browser puzzle where you write python-like code to satisfy rules before a timer deletes it — solo or racing friends live
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:
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!!
helo again!! so after the menu frontend was done last time, spent this session wiring up js to actually make it functional instead of just sitting there as styled html.
added:
taskEngine.js is still on the list, saved it for last since everything else needed to be working first before it made sense to build. tested what’s done so far end to end and caught a handful of small bugs along the way (some css that wasn’t applying, a couple html typos) which I fixed too.
next up: taskEngine.js, then getting the lobby/live-race stuff talking to firebase properly ^_^
helo again!! so quick update on the main menu I mentioned last time: the frontend for it is completely done now!! :Di finished styling the whole thing, here is what’s ready on the screen right now:main buttons for singleplayer, host/join private rooms, and leaderboard ([1] to [4])top bar with day streak tracker and runtime status boxclean footer for how to play & source links now that the main menu frontend is out of the way and not looking like raw HTML anymore, I’m finally moving on to the backend logic for lobbies and real-time multiplayer!! :>
helo!! so I kinda decided to start all over and improve this game because I like torturing myself, I wanted to make the game multiplayer, less boring, so I removed the old simple looking single editor page and now replacing it with a main menu screen!! here players will be able to: host and join private lobbies and play with their friends; play by themselves or play online!! :D so with these new features I decided to add a leaderboard too in order to make it more competitive, leaderboard will consist win streak, best times!! and wins!! also added diff levels so easy, medium, hard are a thing now :>
script.js is done. parser reads whatever you type and pulls out strings, numbers, and lists - inline and multiline. 25 rules with a supersession system so later rules can step on earlier ones without creating impossible states. progressive unlock, 45s countdown, sync button, destruction mode that eats your code line by line from the bottom when the timer runs out.
the layout skeleton is officially complete now that style.css is implemented. i went for a dark, high-contrast, brutalist terminal look to match the puzzle theme.
here are the key UI updates:
the interface looks clean now, so next up i’m wiring the actual parser and the rule engine in script.js to make it work. :3
just finished the index.html skeleton.
as you can see on the right panel, the embedded preview is currently completely raw and unstyled because style.css is literally a blank file right now. looks like a broken 90s blog.
now I’ll move on to style.css so my eyes don’t bleed from this ugly white screen… but I think the structure of .html is fine