Readit News logoReadit News
Syzygies · 4 months ago
The Kodak Research Labs (like Bell Labs) let their researchers play. In the 1960's my father (who later devised the Bayer filter for digital cameras) coded this algorithm for "Jotto" the 5 letter word version of Mastermind.

Computers were so slow that one couldn't consider every word in the dictionary as a potential guess. He decided empirically on a sample size that played well enough.

I became a mathematician. From this childhood exposure, entropy was the first mathematical "concept" beyond arithmetic that I understood.

dang · 4 months ago
This comment goes in the highlights list: https://news.ycombinator.com/highlights!

(I mention this so people will know the list exists, and hopefully email us more nominations when they see an unusually great and interesting comment, like this one.)

spondyl · 4 months ago
Any plans for the HN API to expose highlights? It's a neat high signal collection that I have some custom bit of code that translates it into an RSS feed but an official endpoint would be neat :)
irchans · 4 months ago
> I became a mathematician. From this childhood exposure, entropy was the first mathematical "concept" beyond arithmetic that I understood.

Very cool.

entropicdrifter · 4 months ago
I too became a fan of this game from an early age, note the username
UltraSane · 4 months ago
What is it like being cited by Satoshi Nakamoto?
mqtx · 4 months ago
That reminds me, I wrote it for iPhone when it was released in 2007 - back then there was no App Store, so apps could only be written for browsers. I think I implemented it whenever I learned a new language. By the way, I noticed that Claude, ChatGPT, and DeepSeek - none of those LLMs can solve Mastermind. They get lost after a few iterations, no matter how good the prompt instructions are. Source: https://github.com/muquit/iphonemm - there is a link to play on that page.
fuzzfactor · 4 months ago
I'm in an older generation, but like some other commenters started young with logic games as a preteen. I got into a school that was recognized for its academic games program but that was years before Mastermind came out.

By then I was in college with some of my high school buddies when one of them got the original board game. These were not actually that common even among those who liked thinking games since they were about $10, for $1 worth of plastic. And the box was way small compared to the full-size popular board games which were about $5.

It was quite interesting that there were diverse international people pictured on the cover and it didn't take long to realize this was a game where no players need to speak the same language at all.

By the time I got my Atari computer, this was the only game I ever coded since it's absolutely perfect to play having the computer in the role of "codemaker". I had never seen or heard of a computer mouse but I had my trackball for playing Centipedes and Missle Command so used it to point & click, then before I was done I was dragging & dropping the colors from their repository to the hot spots. I was simulating picking & placing like the board game.

Eventually I used two columns so two players could play against the Atari simultaneously, each with their own trackball or joystick. Since it was always basically a "one-player" game doing the solving, then two people could solve at once. I was going to suggest trying it that way next time but I don't know if it's as straightforward to use two mice and associate one with each player.

conception · 4 months ago
You can ask them to write a script to solve it however and it is a trivial task for an LLM.
mqtx · 4 months ago
I'm talking about interactive play with an LLM - for example, explaining the rules and scoring in detail first. Then I tell it to pick colors, and I provide the score. When the score indicate 2 colors matched, it's supposed to keep those 2 colors constant in the next move. But after I pointed out that it forgot again after the next move and continued making the same mistake, it was Claude 3.5. So at the end I said, 'It looks like you can never solve this puzzle. Now that you know all the rules, can you write the game in JavaScript?' Sure enough, it did, and it worked on the first try - and was much prettier than my version. Same for ChatGPT, DeepSeek.
juxhindb · 4 months ago
One fun assignment at Oxford's Comp. Sci. department was solving Mastermind in Haskell using minmax. Knuth has a particularly fun paper on it in fact - https://www.cs.uni.edu/~wallingf/teaching/cs3530/resources/k...
mrbluecoat · 4 months ago
I grew up with this game. It hurt my brain but in a good way. I think a lot of my problem solving and interest in coding stemmed from it.
cortesoft · 4 months ago
Had the same experience. I loved playing with my mom, and I remember spending a lot of time thinking about how to optimize my guesses. It fit all my hobbies around logic.
bethekidyouwant · 4 months ago
My grade school had a game club at lunch hour. Mr. Newton took time out of his day, every day for us. Still think about him and the many games he brought from his had personal collection. Not sure what the point of this message is other than that he will be remembered until the last time I think about mastermind, Pacific typhoon, star fleet battles, axis and allies and many others..
SchwKatze · 4 months ago
I had a friend in my high school that was just like that, any day with not class was a excuse to bring some boardgame and spend hours playing in the empty classroom. Xcom, catan, zombicide, ticket ride, and so on
Saigonautica · 4 months ago
Oh, I loved working on this problem years back.

My strategy was simulate my possible next guesses against all possible codes, then pick the option that had the highest number of possible outcomes (sometimes this strategy is called MaxParts). It looks like the author's approach works for similar underlying reasons.

Besides this, I applied some optimizations for the starting move, and some further optimizations on considering 'irrational' guesses -- e.g. choosing a code that had already been eliminated as a possibility, because it returned more information (this was rare, but possible).

I ran my code against all possible games of 4,6 mastermind (I win in an average of 4.2778 guesses), and found that some starting guesses were more optimal than others! The pattern "AABC" (e.g. red-red-yellow-green) was the best performer. Perhaps this is a way that the author can improve their algorithm just a tiny bit.

rokkamokka · 4 months ago
I love stuff like this. It always tickles my brain to try and find the optimal way (or, as optimal a way as I can) of solving puzzles. Sometimes it's easy, sometimes it's really hard. Oftentimes you can get something decent with not too much effort, and the dopamine hit is great when you see it working
psychoslave · 4 months ago
I didn't back it with any formal reflection, but I played the game a bit with my daughter last year.

We had some fun and nice exchange around it, but closing all parties in just 4 rounds made it quickly boring.