Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

The code design is also very elegant in its simplicity.

You have two static lists of words in the JS code - known words, and a smaller, random pre-shuffled list of words the game will select from.

The selection is done on the client, by date, from the second list - every day at midnight (your local time!) the next word in the pre-shuffled list is selected - no hashing or randomizing or anything. No cookies are involved in making you play one game per day, no server side calls are involved in gameplay at all. And yes, this means that changing your time zone will let you play tomorrow's game, and that you can just view source to know tomorrow's word - it appears right after today's word in the code.

This is so counter to how we usually design software in so many ways, it's just delightful.



When I first discovered Wordle, I immediately looked for a way to keep playing with new random words, something that most clones have implemented.

After a few rounds, it just wasn't as fun. What makes it fun to spend 10 minutes on the game is that it's the only round of the day so there's a pay-off to giving it some thought. When you can keep playing new rounds, it's just not rewarding and I would just close the tab when I was stumped.

Had I invented Wordle, I would never have thought of just one, shared round per day which is surely one of the critical elements of its success.


> After a few rounds, it just wasn't as fun.

Absolutely. If that limitation wasn't there, the game would've definitely fizzled out within days and maybe even never made to it the popularity it has now. The slow sustained popularity, with people posting their results on the shared daily word is the key to success here.

It's the only reason people are still talking about it more than a month later.


This is also why I strongly prefer the HBO release model to the Netflix model.


Strongly disagree on this assertion. Each to their own, so I'm not going to pretend that we're having an objective discussion here to start with :P. Personally the wordle model works for, something like wordle, but doesn't extend much further. I lose interest in a story fairly quickly if slowly drip fed over weeks and months. As a result I have watched FAR more shows after Netflix model than before it; I suspect I'm not the only one. I will wait until all episodes are released first to even start watching now; but often, don't continue with shows with HBP release model at all and move on to something else. The entire point of a story (for me atleast) is to get sucked into a different world and find out more while your mind is engaged. The "pay off" waiting a week to find the next bit of information is far less than the friction of first, abruptly being thrown off your train of thought, and secondly, to start caring about the story a few moments before or as the next episode is being played. Its like chasing a deep bug in the weeds of legacy code base and then suddenly having to have to switch context for a week and then told to chase that bug again. Even if I find it next time, there's no satisfaction anymore.


To be fair there's two things at play here. On the one hand, I agree it may be more enjoyable for you to watch it all at your own pace. On the other hand, I think it's objectively true that the HBO/Disney model does more to keep a show in the headlines and the cultural pulse. Look how shows like WandaVision dominated Twitter every week for 2 months. The only two shows that have managed to have staying power on Netflix were Tiger King and Squid game.


For me, the HBO model for Wordle would be one guess a week, and ~6 weeks to complete a game.


I think that's correspondence chess. Or correspondence something, at least.


Or watching a football game 5 minutes at a time, every week.


Game of Thrones really showed how successful it can be. Season 1-4 really was an amazing time to be a fan.

But that also made it possible for them to succumb to mainstream fan culture, the cult of the badass and so on, they wanted to ride the attention wave :(


The HBO model works better for shows that are going to have more than one season because in the first season people haven't generally heard of it.


> Had I invented Wordle, I would never have thought of just one, shared round per day

This is the core mechanic of a newspaper crossword (or the NYT Spelling Bee) which inspired Wordle. It’s really no surprise when you think of it that way.


I have been playing Quordle as well, and now find Wordle very slow and dull. I'll persist as long as my streak is active (60+ or whatever) but bail if it breaks. I play 10-20 games of Quordle a day and find it more interesting, challenging with IMO more difficult words, etc.

But I can appreciate that one shared round was key to Wordle being noticed.


+1 quordle making wordle seem dull.

But I only place the official once a day. I suck at it I think, but they do a great job of making it rewarding.

Also their continuous improvement on the front end is a daily side game, to see what they changed today.


Yeah they added links to dictionary, which as a non native speaker, find great (I was already searching for words I didn't know, and now it's super convenient)


I've also tried Octordle now, that one's super challenging. In a harder version like that one, having a practice mode you can repeat as much as you want can be addicting on its own


I tried the Octordle one and found it easy enough but awkward to play. Quordle seems like the winning combo. The way I've found to keep Quordle really interesting is trying to win in six moves as many times as possible (got it nine times so far), and then trying to finish in seven more times than nine. That's made the Practice Mode "sticky" for me.


quordle seems to be the ideal number of boards, 8 and 16 get too easy because most of the letters show up somewhere and you get into the mopping up phase pretty soon.


Agreed -- sedecordle seems to have far less risk-of-not-succeeding peril than quordle.


This mechanic you describe is actually quite common in freemium games. Games like Farmville don’t let you burn yourself out and purposely make you wait and come back hours or days later to get that dope rush.


> This mechanic you describe is actually quite common in freemium games. Games like Farmville don’t let you burn yourself out and purposely make you wait and come back hours or days later to get that dope rush.

They don't do it to avoid burnout, they do it as a payment gate-keeper: you have to pay to progress in any meaningful way.


Don’t they let you pay to bypass that?


The daily bit is clearly modeled off the New York Times daily word puzzles, and it's obvious why the NYT bought it to add it to their collection of daily word games.


The NYT day resets at the same time for everyone though


True, but so long as you play it at roughly the same time every day, you're going to encounter a new puzzle at that time, time zone differences notwithstanding.


and I wouldn't be surprised if they change wordle to do that at some point.


> I would never have thought of just one, shared round per day which is surely one of the critical elements of its success

It's different anyway, but how are people building routines around remembering to visit a certain website once a day? Do they just see the shares on Twitter and remember to go play themselves? Do they bookmark it? I certainly can't build a routine around a novelty like Wordle.


My wife and I have made it part of our morning routine to play it while we drink our coffee.


> Had I invented Wordle, I would never have thought of just one, shared round per day which is surely one of the critical elements of its success.

It's probably the same with Twitter's char limit.


In some ways it reminds me of Twitter - the innovation was in restricting the content, not in adding more features.


Making the whole thing client side also let him scale from a small handful of users to literally millions with basically zero additional work.

I hope it inspires future devs to let go of feeling like they absolutely need to beg or require users to create accounts to capture email addresses just so they have a chance at monetizing their thing. Wordle may not have ever caught on if it were preemptively over-engineered: it could've added friction to the onboarding, the site could crash, etc.

You can just build a great MVP and let it loose into the world, then see what happens.


I wish I were smart enough to coin a catchy phrase that means "the moment some software dropped in quality, when they decided to add user accounts", because I see this quite a lot.

I'm looking at you, Postman!


This actually hurt to read, having used Postman since its launch. It was such a great, simple product then with a simple premise - easily make http requests from a simple ui. Since then, feature after feature has been added, now it's just total bloatware cruft, to the point where after having taken a break for several years, I found it relatively difficult to use upon return (especially if you want to avoid sign up). I see they've recently gotten a series d (!?) of $225 million, so good for them I guess, but it's not something I almost ever use any more, and no longer feel drawn to...


Ditto. I used Postman pre-rework and then came back and had to spend 10 minutes trying to find the page to make an actual callout. And I still can’t find it on the first try whenever I re-use the service.


I'm old enough to remember when Google didn't have user accounts.


> I'm looking at you, Postman!

In order to use a websocket connection with postman you need to be signed into postman. I would love to switch to something else, unfortunately postman is the only tool I know which has built-in debugging tools for socket.io


Oh yeah, and postman teams practically removed all your stored requests.

In the same space, i love how Telerik kept Fiddler Classic useable!


Yes, I left Postman immediately after rework because I couldn't understand how the hell to use it anymore.

Same with Docker Desktop. I tried to use it for personal use a few weeks ago and couldn't figure out how to docker build a container anymore on WSL, then tried on native Windows and it was jabbering on about HyperV prereq and I just uninstalled it and went back to WSL for traditional package management.

I think Docker shot themselves in the foot.


“Monetize”


> Making the whole thing client side also let him scale from a small handful of users to literally millions with basically zero additional work.

But everyone on HN is telling me that I should move away from client side and render everything server side! In fact, all state should be server side! Use a fancy library that opens a web socket and turn the users 4+core computer into a mindless zombie controlled by a .25CPU VM somewhere.

/s


I don't know how Wordle managed to scale to 3 million players without Kubernetes, it must be magic.


When people ask me why I like SPAs:

Because web servers are really good at serving up static files.

That is it. I get to make an app, deliver it through the web, and not worry about server resources. I do have to worry about making the app not suck, but as a software engineer I should always be worrying about that! Web, mobile, desktop, making code not a bloated mess is kind of important no matter where it is running.


You're dumping all the compute requirements onto the client. But that's not always a bad thing. When done good, it's pretty good. Prime example: Worldle. No need to hate frontend.


Removing any friction for new users or players is such a huge deal, more sites should embrace this approach. Similar to how Facebook created ghost users for everyone, why not make this explicit? There are a number of plugins for popular web frameworks that create temporary user accounts for each visitor, allowing them to use the site just like a regular user. This way it's a bit more sophisticated than plain old sessions which allows it to be integrated in existing sites as well.

And if the visitor abandons the site their data will just be garbage-collected after a while.


They could have at least thrown in a microservice or two to breathe some air into that fad.


I forgot to play one day, so at just after midnight, I set my TZ to Hawaii to catch up. After I finished, I set it back to PST.

When I went to play the next day's game, it acted like I had already solved the puzzle at midnight. I had to manually edit localStorage to fix my state (or presumably skip a game).

This was when it was still hosted on Josh's site, but be weary of changing TZs to get other day's puzzles. The game might get confused.


Yeah I had the same thing happen. I would jump ahead two hours to play it at night. This morning it kept showing me the same 3-day-old game, no matter what I did. I had to clean out cache, local storage, cookies and everything to finally get it to start playing again.


I think the full list of words being hardcoded and readily available is not a kind of elegant simplicity, but simply an inelegant compromise to get everything done client-side, which has obvious benefits. It's the one thing I would change about Wordle's implementation.


> an inelegant compromise ... It's the one thing I would change about Wordle's implementation

What would you change specifically? Adding an API call backed by servers / lambdas? The creator mentioned it costs in the tens of dollars per month to run wordle for 10s of millions of daily players. Having to run servers would not only add a ton of cost, but now be vulnerable to latency spikes, ddos, downtime.

Wordle scaled to 10s of millions in a few months, without any latency or downtime. Pretty elegant in my book.


Well yes, an API call or an encrypted/hashed DB of words so at least it's not casually accessible.

I understand that the costs might be an issue, but this doesn't make the solution "elegant". This is the kind of code I wrote as an 8-year old in BASIC, like I mentioned elsewhere, and even my young self understood back then it wasn't a satisfying solution, I just didn't know how to hide secret literals.

I mean, I enjoy Wordle as much as the next person, but let's not make it into some engineering achievement when it's clearly not one.


> so at least it's not casually accessible

I'd argue that it's not. Puzzles in the newspapers also don't hide secrets, the answers are on the next page or upside down. And for wordle, the vast majority of players don't even know the solutions can be found in the source (because they don't know what that means), and most of the ones who do know that don't look anyway because otherwise what's the point of playing.

Having the solutions viewable client side may not be engineering elegance, but in this case I do think it is product elegance.

Adding the DB or servers you mentioned would mean costs continue to increase with # of users, which would then create pressure to figure out how to make money off of wordle. Then comes logins, ads, or at the very least donation requests


> which would then create pressure to figure out how to make money off of wordle

Oh, you got me there! Definitely wouldn't want that to happen.

You make good points. It's true the solution to newspaper crosswords is usually on the same page, upside down.


What's the problem with making the words accessible? It's not a secret. It is most definitely an engineering achievement. The author actually had a clear vision of what he wanted to achieve and he achieved that goal in a very minimal and scalable way. Engineering achievements don't have to be innovative complex codebases.


Why tho? Cheating just takes away from the cheater's experience and doesn't affect anyone else. It's pretty much like any physical game. You can play (or cheat) it any way you like even though the game is designed to be played in a certain way.


I agree with your philosophy against cheating, but still, games must implement some sort of anticheat, just like they must implement some sort of game rules.

Imagine not implementing blocking walls in Counter Strike, "just don't walk through walls, it would make the game less fun and why would you ruin the experience for yourself like that?".

This is a case where not hiding the word list was done because it was easier to implement Wordle this way. Engineering-wise, it's not elegant, it's a cop-out.


With Wordle, you only play against yourself, so cheating only cheats yourself. So no need for anti cheating.

Client side dictionary isn’t a cop out at all. It’s a terrific solution for a single player game that helps keep the code base elegant.


> so cheating only cheats yourself

Well, cheating is less important than in Counter Strike, but not entirely unimportant either. Playing Wordle has a social component.

I think this solution is neither elegant nor terrific. It's simply completely ignoring the problem and claiming that it doesn't matter anyway. I obviously disagree.

PS: when I was a kid, I learned programming on my C64 with BASIC. Like many kids, the first programs I wrote were "guess the thing" kind of games. Usually "guess the number", but occasionally "guess the word". Even back then I understood that hardcoding the word in the program listing was less than ideal, but I just didn't know how to do better. Let's say that 8-year old me would not have been positively impressed if told that Wordle had the "elegant" solution of storing the list of words in its source code.


I think cheating would matter if there was individual words tied to an account. But not when the design says every browser session on the planet gets the same word.


Fair enough, but then it's not an "elegant" decision we should be in awe of (as in the title "Wordle is pretty damn smart").

It's just the default of "I decided not to tackle this problem because it's hard and not a priority for my design". This was also what I defaulted to with my C64 BASIC games when I was a kid, "I don't know how to hide this, so I won't".


Rather, the conclusion is, "I don't _need_ to hide these, so I won't."


> Playing Wordle has a social component.

...and it's trust model extends there too. It copies your "Achievements" into your paste buffer and you paste them to share. One could easily edit their results, but they'd be cheating themselves too. There's not need for technical restrictions on a player ruining their own satisfaction.


Not at all the same as in counter strike, as if one person was walking through walls, it'd break it for everyone else not walking through walls.

My wordle doesn't get worse from you cheating, but my game of CS sure would.


Replace Counter Strike with a single player FPS then.

"I don't need to implement wall blocking, the player should just refrain from walking through walls". It's not elegant, it's lazy.


> Replace Counter Strike with a single player FPS then.

Single player games included cheatcodes hard-coded in them since forever. Those that didn't had "trainers" which fiddled with game memory with the same effect. Howver, invincibility and infinite ammo tend to ruin the game for most people.


But the equivalent analogy to Wordle in this case would be not implementing the letter check or not hiding the correct answer until you figure it out. That mechanism exists.


Every design decision is a compromise. "Inelegant" is simply another word for "I would've done in it a different way".


I would have done most of this in a different way, but looking at how this guy solved all those problems made me really stop and think about how I approach problems, and I actually think he did it in a more elegant way that I would have.


> No cookies are involved in making you play one game per day

The game does, however, use local storage to keep your score, and progress along today’s puzzle.


Sure, what I meant is that even if you delete your cookies you'll play the same round.


> This is so counter to how we usually design software in so many ways, it's just delightful.

It's letting go of notions of what makes good code. I had a Moment like that doing Pico-8, since you can only fit 40 or so characters on screen, all the tutorials just use dirty, single or two letter variable names, and since everything is small and you learn a few neat tricks about variables (velocity, coordinates, the mod operator), the code can be really compact... and filthy. It's great.


If you like the code-golfing aspect of it, I suggest you take a look at the #tweetcart hashtag on Twitter, there are some incredible demos in 280 chars or less.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: