Clever and totally pointless – my first publication

Way back in the early 90s, I subscribed to a magazine (think of it like a big website but printed on paper and sent through the post) called ā€˜PC Plusā€™. It included a section called ā€œWilfā€™s Programmers Workshopā€ where every month, Mr Wilf Hey would present a project (usually written in GW-Basic) and discuss the principles at work. It was here where I first managed to get something clever into print, except I didnā€™t do it quite right.

There would usually be a brief digression at the end of his section, and in one issue, he discussed the idea of a ā€œquineā€, a program whose only function is to generate its own source code.

printf(f,34,f,34,10);

It was from this I had an idea of a creative way to produce a quine of my own. I just had to be liberal about the definition of a programming language. Hereā€™s my (faulty) recollection of Mr Heyā€™s write-up of my entryā€¦

We had a clever entry to our discussion of self-replicating programs from Bill Godfrey who sent in a floppy disk, and it meets the rules of the game.

Run the program SELFREP.EXE and it produces the ā€œsourceā€, PKZIP.EXE itself. He supplies a batch file which recompiles the program. First, PKZIP ā€œcompilesā€ SELFREP.OBJ (instead of .ZIP) and then the ā€œlinkerā€ ZIP2EXE is invoked to produce the completed executable program.

Unfortunately, because Mr Godfrey didnā€™t write PKZIP, heā€™s technically disqualified from this contest.

Once the initial excitement of appearing in print wore off, I was kicking myself for not thinking my idea through. I only used PKZIP.EXE as the source file because I needed a file to be the source code, and PKZIP itself seemed the most applicable for that role. That decision alone disqualified me.

What I should have done is supply some ā€œsource codeā€ such asā€¦
   /* A self replicating program by Bill Godfrey. */
   Go();

The batch file should have just compiled (zipped) that two line text file and then linked (zip2exe) it. Running the generated EXE would have produced the same two line text file back. It would have totally complied with the rules and I would not have been disqualified! Grrrrā€¦

Iā€™ve long since lost that edition of PC Plus. If anyone reading this has a copy, Iā€™d love a scan of that page please.

Picture credits
ā€œReading a magazineā€ by flickr user ā€œZaCky ą„ā€.
ā€œDanger – Self Replicating Device!ā€ by Sam Ley, aka flickr user ā€œphidauexā€.