The purpose of this site is to share and discuss programmatic solutions to New Scientist‘s Enigma puzzles.
I’ve been writing programs to solve the puzzles for a few years now, originally in Perl and more recently in Python, as a way to have a weekly programming challenge. Some of my Python programs use useful routines from my enigma.py library. (If you would like to also use it, and let me know if you have any problems, that would be appreciated).
The purpose of the challenge (for me) is not necessarily to produce the shortest possible program, or the fastest executing, but to produce a nice readable solution that can been seen to be right by looking at it, and executes in a reasonable time (usually less than 10 seconds, but essentially shorter than it would take to write (and debug) a more complicated solution). I usually try to write a program that produces a constructive solution and verifies all the conditions stated in the puzzle. And if the program can be used to solve a class of similar puzzles (or easily modified to do this) then that’s even better.
Enigma puzzles ran in New Scientist magazine from February 1979 up to December 2013, I add puzzles to the site typically every Monday and Friday, alternating the oldest unpublished puzzle with the newest unpublished puzzle.
The easiest way to keep track of puzzles is to subscribe to the RSS feed for the site, or to sign up for email notifications, but I also post announcements of the puzzles to the Facebook Enigmatic Code page as they are made available on the site.
If you use the site as a source of puzzles please include a link back to the puzzle on this site.
Feel free to join in, either by leaving a comment (with a program if you like), or by rating puzzles or just “liking” them. If you want to leave a general comment about the site, please do so below. Any kind of feedback is useful in encouraging me to keep the site going!
- I am not affiliated with New Scientist magazine in any way (other than subscribing to it), nor am I paid for running this site.
- This is an English language site so I’m only able to accept comments in English. Sorry. But you can use whatever programming language you like when posting code.
- Feel free to also post analytic (non-programmed) solutions or notes of general interest.
- Comments are moderated and any that stray from civil discussion of Enigma puzzles will be edited or removed. When you first comment on the site (and sometimes at other times) comments are held for moderation so won’t appear immediately on the site, after that they usually will, but occasionally WordPress’s spam-filtering will hold up messages. I try to check the messages held for moderation at least once a day.
- The site is hosted on WordPress which has limited support for preview or editing of comments, so bear that in mind before hitting “Post”. (I recommend composing the comment offline, and if it goes wrong you can email me the original version and I can amend the comment accordingly). If you wish to remove or update a comment let me know and I’ll sort it out. (And if you’ve got any suggestions for a better place to host the site, let me know).
- See the Notes page for some tips on posting to the site.
- The text of the original puzzles is copyright New Scientist and/or the original authors of the puzzles. They are reproduced on this site (with links where possible) in order to facilitate discussions of their solutions. Copyright of the comments remains with the original authors of the comments.
I just rated 20 enigmas, 2 of which I gave 5 stars to!
I’m trying to get my students into these types of logic puzzles. They’re grade 8s, so starting with very basic stuff….i.e. AA + B = BCC etc….MMy dad once made a whole wack load of these for his students when he was a teacher, and I’m looking for a resource that might have them made up. Any ideas?
If you search for “cryptarithm” or “alphametic” you can find people who have compiled lists of these puzzles. For example at the following sites:
If you are familiar with programming you can use the [[
SubstitutedSum()]] class from the enigma.py library to solve these:
It will print out a line for each solution that it finds.
Given a list of words you can also use [[
SubstitutedSum()]] to generate these puzzles.
Here’s a program which looks for words from ZERO, ONE, TWO, …, TWENTY, THIRTY, FORTY, …, NINETY, and generates puzzles from them:
It finds puzzles with unique solutions.
Here are the ones it finds with two summands (without solutions, in case you want to try them):
You can change the definition of n at line 9 to find sums with more than two summands.
Apologies if I’m posting this comment on the wrong page but I have a question about alphametic puzzles like the well-known SEND+MORE=MONEY puzzle. These are quite common in ENIGMA’s. My question is: Are all alphametics solvable WITHOUT trial and error? The obvious answer is No, but I’m not certain. If at least some alphametics require trial and error then it would justify the use of a computer program to do this task. However, I am in no way suggesting that justification is necessary for using the computer to solve alphametics or any ENIGMA puzzles. I, like most people on this site, enjoy writing programs to solve ENIGMA’s and that’s just fine – no justification necessary. Thanks for reading.
@webunit80: Thanks for your comment.
I think there is some element of trial and error in most alphametic puzzles. For example, in simple sums each column will give a constraint on the symbols used in that column (although for all but the rightmost column potential carries must be considered), so you can sometimes work out (or at least restrict) the values of some of the symbols based on that. But in the end, even with a restrictions on some of the symbols, you end up trying the possibilities and seeing if they work.
I have written some programmatic solvers for alphametic puzzles that are available in the enigma.py Python library. [[
SubstitutedSum()]] works on simple addition sums, and [[
SubstitutedExpression()]] can be used in general Python expressions.
Thanks for the info and I’ll definitely check out your Python programs. I’ve written a few myself in another language that shall not be named, but I’d like to get more experience with Python.
Jim, I was looking at the list of ENIGMA’s and I see that many do not have links (not underlined) even though they don’t indicate that they’re missing. What does this mean? Also, I have some of the puzzles noted as missing. I can send them to you.
@webunit80: The puzzles that are listed, but do not currently have links on the “List of Enigma Puzzles” page are those that I have been able to source and transcribe, but are not yet posted to the site.
I try to keep to a schedule of posting two Enigma puzzles every week. The lowest numbered unposted puzzle on Monday, and highest numbered unposted puzzle on a Friday. But if there is a particular puzzle you would like to see included on the site ahead of this schedule I can bring it forward.
I have also been posting bonus puzzles on a Wednesday, usually taken from the Puzzle or Tantalizer series of puzzles that appeared in New Scientist before Enigma started. And now I also post the puzzles appearing in the current issues of New Scientist on a Saturday.
There are currently 465 Enigma puzzles that remain to be posted on the site, and I have around 85 left to source (from 1996-1998). But I am being helped in the regard by a colleague who is able to send me images of the missing puzzles before I am due to post them. I am happy that I will get an almost complete archive of Enigma puzzles in this way, but if you have easy access to the missing puzzles (or sources for the few that remain outside this range marked [missing] or [incomplete]) that would be appreciated.
I’ve been meaning to write to you for a while now. I’ve been following your work with the New Scientist puzzles and using them to teach myself Python. At the start, I depended heavily on your work, but I have moved to doing many of the puzzles by myself and checking my results with yours. I’m really impressed with your output and appreciate your help (even though unbeknownst to you) for my Python education.
I am registered to receive your regular emails.
I’m doing these puzzles, and learning Python, purely for enjoyment, as I guess you are too.
Thank you so much.
I received an email from you for Tantalizer 230: Women’s lib, but the link does not work. I have tried several times. I managed to find the “original” online and also the solution. If you want I could email them (jpgs) to you.
Keep up the great work. (I am already on your mailling list)
I have transcribed all Tantalizer puzzles back to Tantalizer 181 (using the Google Books archive of New Scientist magazines), and am slowly working through posting them. I probably hit “Publish” instead of “Save” when I was transcribing the puzzle if you got an email, but I can bring it forward if you’ve been looking at it. (Otherwise I am just posting the most recent unposted puzzle each time a Tantalizer is due).
Thanks Jim. I managed to see the puzzle and the solution (via Google) so I don’t need anything more. I just wanted to let you know.
Thanks again for all your posts. I’m having great fun working through the puzzles (selected ones) and solving them (or trying to).
Hi! How can I post code (solution) for Puzzle #54?
Code can be included in comments like this:
<code goes here>
Syntax highlighting for other languages is available (see [link], or use
language="text"for no highlighting).
Unfortunately, WordPress doesn’t have the ability for you to edit comments once they are posted, so do give it a read through before pressing “Post Comment”.
Congratulations, Jim! Great work and site! 👍