The Original Macintosh:    80 of 127 
The Puzzle
Author: Andy Hertzfeld
Date: September 1983
Characters: Andy Hertzfeld, Jerome Coonen
Topics: Software Design, Management
Summary: The puzzle desk accessory became controversial.
The Puzzle desk accessory

The original Macintosh could only run one real application at a time, but it could also concurrently run little programs called "desk accessories" that shared memory with the main application. Like the system itself, most of the desk accessories were written in 68000 assembly language, but in the fall of 1982, I decided to write one in Pascal as a proof of concept and to show developers how to do it, by writing a tiny adaptor that the Pascal code linked with.

Desk accessories were usually utilities, like the calculator or the alarm clock, but I thought that we should also have a game or two, to show that the Macintosh was fun, too. I decided to write a "15 number puzzle", where there are fifteen numbered tiles in a four by four space that must be arranged in sequential order. If you click on a tile next to the empty space, it slides into that space. It was a fun way to waste time and build up your mouse coordination.

Since the number puzzle was written in Pascal, it had to link with the Pascal run-time, which dragged in lots of extra code that wasn't used. This made the Puzzle over 6K bytes long, even though most of it was just the run-time.

By the fall of 1983, it was time to make decisions about what to include in the shipping product. We had shown the Mac to a number of industry analysts, and while most were enthusiastic, some didn't really get the graphical user interface and thought it was "game-like", not suitable for serious computing. This made some of the Macintosh marketing folks a bit leery about the more whimsical aspects of the design, and the puzzle, being an actual game, became somewhat controversial.

Jerome Coonen, the software manager, came by my cubicle one morning to tell me that they decided not to ship the puzzle, partially because of the game-like perception, but mostly because it was just too big. Applications were very tight on RAM, and the puzzle was one of the biggest desk accessories because it was written in Pascal. At over 6K bytes, it also ate into the available disk space.

I liked the puzzle and I didn't want to capitulate to the buttoned-down, all business view of the customer, so I told Jerome, "You know, the puzzle doesn't have to be so big. I bet I could rewrite it and get it to take up less than 1K bytes. Would you keep it if I got it that small, or is it really the other issue?"

Jerome thought about it, and then told me if I could get it down to 600 bytes or so, it would be in the release. The only problem was I had to get it done over the weekend, because they had to send the manuals out to the printer soon, and there was plenty of other stuff for me to work on.

Of course, I couldn't resist a challenge like that. It only took a few hours on Saturday to recode it in assembly language, and get it down to the required 600 bytes, since it no longer had to link with the bulky Pascal code. I proudly showed it off to everyone on Monday, and it did make it into the first release, and stayed there for many years, although it was completely rewritten a couple of times, for various reasons.

Close Encounters of the Steve Kind
Back to The Original Macintosh
How to Hire Insanely Great Employees

Account Name:


Create new account
Overall Rating: 4.00

Your rating:





Was the original Pascal or 68k assembler language ever released to the public? I've actually come across somebody online who claims to use the original Puzzle DA's algorithm to produce the initial puzzle state. (However, there's a problem in his implementation where it's possible to produce a result that results in a swapped 15/14 state, which is supposedly unsolvable.)
Well that just shows how observant I am... the above comment's from that "somebody" Perhaps the 15/14 was one of the reasons the Puzzle DA was rewritten over the years?
I'm very glad the puzzle made the final release. As a kid the first thing I'd look for on a computer were the games. Had the puzzle been missing, my first impression of Mac wouldn't have been nearly as high.
When I was in High School, I used to babysit for my neighbors across the street. Long about 1984, a brand new Mac appeared at their house. The dad was a business type, so he didn't have any 'interesting' software to me. No languages, no assembler, just financial gorp. (And where in the world was the command line?!?) But there was... the Puzzle. Each time I'd babysit, after putting the girls to bed, I'd fire up the Mac. I'd drop in a boot diskette and head over to Puzzle. It's amazing how little reward there was for solving it - it would blink a few times, and then it would emit the same *BING* you get on boot-up. That's it. But sure enough, there I'd be, getting my fix every chance I got. Thanks for getting it in there, Andy!
If you just randomize the initial positions, there is a 50/50 chance that you get a solveable puzzle. The other half have the swapped 15/14 problem, but on the other hand you can arrange them "backwards", beginning with 15-14-13-12 on the first row. There is a simple mathematical test that you can make to determine if a puzzle is solveable - I suspect that the updated verison simply makes this test and randomizes the pieces again if it fails.
In the early 80s I used to work for the NY area manufacturer's rep for Apple. At the time Apple was too small to support the computer stores that sold Apple so they used Rep firms. I worked for CMG, which trained and supported all authorized Apple stores from Princeton, NJ, through Manhattan's 5 boroughs and on up into White Plains. OK so it's 1/9/84 and we are rolling out the Mac to the dealers and the media. Steve is doing one of his great Mac demos on one Mac and I was on another one up front on his left. So Steve uses The Puzzle to show off his mouse prowess. I did the same on the other Mac up front. The problem is that I beat Steve and he was pissed as hell ;) He was a great guy but don't piss him off or embarrass him. I didn't mean to I swear. But it was funny.