Allen writes: This program plays Master Mind. Start it by typing: please begin game Enter moves by typing: (aaaa) guess Guesses should be strings of length four and contain the letters a-g. These parameters can be changed (see notes below). I have spent may hours- uh- debugging this program. Yeah, I wasn't playing games, honest! I was discussing the contest with someone here and we came to the interactive category. He asked what that meant and what good an interactive PostScript program could be. I jokingly said that I should write a chess program. Well, I've never much cared for chess and the size and memory limitations might be restrictive, so I fooled with tic-tac-toe and then settled on Master Mind. The program took a while to put together because of my refusal to use an excessive amount of dictionary space or to leave anything on the stack between turns. As a result, most of the obfuscation is procedural. The large number of stack operations can be quite dizzying if you don't keep good count. It's easier now that it works, but there were some debugging problems. :-) After I got it working, I added the graphics, which are pretty good and very well behaved, but it's hard to differentiate the gray shades in the output. I was going to map them to colors, but that didn't help on grayscale displays. Then I changed most of the names. If you change the names back to sensible things, the program is much more readable. It's kind of a cheap trick, but not one unheard of in The Real World. :-) Lastly, I munged the formatting in subtle ways to make visual grouping more annoying. I also dropped a name that looks like a radix number (I was going to exploit that more fully but didn't get to it) and some lexically unpleasing names (like \). My LaserWriter found \ so unpleasant that it wouldn't run the code correctly. That explains the patch that changed "/\" to (\\) cvn. Change it back if your scanner can handle it (it >should<). I did not, though it was suggested, change or delete the strings printed as informative messages by the program. That would have made it much harder to figure out, but I thought some clues were a good idea. The idea was to make it tricky to figure out, but give you some good places to start. I think this program is a good example of a real program that is fairly well implemented but still hard to follow. It's also brief enough to print out and mull over over lunch. Happy chewing! Notes: The game's in a dictionary. Note how configurable it is. You can change anything but the paper size very easily. How would you change that? Note the (ab)use of forall throughout. Remember that forall is polymorphic- that it has different effects with operands of different types. Do you have to enter your move as a string? It's very easy to cheat. How? The user interface as text or graphics is very nice, but the two are different. I wanted them both to be pretty so I didn't use letters on the graphics. (Plus I didn't know what fonts were available from gs.) Makes it more confusing too, which is the point of obfuscation. I didn't pack the code into a block of text. That's a rather weak form of obfuscation if the reader knows how to format programs better. I did deviate from my normal style to make parts more confusing, but I feel the program is complicated enough to stand on its own. :-) Note the very small number of names bound in the dictionary please. Would the code be easier to follow if I'd used a few more? Why do you think I kept so many things on the stack (other than to confuse you)? This program demonstrates changing the graphic state to make your life much easier. Well, something like that. Note that 16#egad is neither a radix number nor a syntax error. Why? Also \ does not have any special effect outside of strings. The function "resign" which quits out of the game cleanly is left as an exercise for the student.