Most Unusual Data Structure

Peter J Ruczynski.
Pyramid Technology Ltd.
Pyramid House,
Solatron Road
Hants GU14 7PL
England, U.K.

Judges' comments:

This program prints out a string. Can you figure out how it is done?

By use of pointers to functions returning a struct of pointers to functions!

Note that some compilers will be unable to compile the expression ‘X=g()…’ in main due to lack of temporary value space. One might want to try replacing main with:


if this is a problem.

Spoiler: (rot13 to read)

Guvf cebtenz cevagf bhg gur fgevat:

gur dhvpx oebja sbk whzcrq bire gur ynml qbt

ol hfr bs cbvagref gb shapgvbaf ergheavat n fgehpg bs cbvagref 
gb shapgvbaf!

Selected notes from the author: (rot13 to read)

Vg vf fvzcyr gb znxr gur cebtenz cevag bgure fgevatf.  Rnpu
nycunorgvpny punenpgre sebz n gb m vf cevagrq bhg nf vgf

    n->m o->l p->k rgp

Gb rapbqr n arj fgevat vachg gur fgevat nf vg vf zrnag gb pbzr bhg:


Abgr: F() ercerfragf n fcnpr naq A() n arjyvar.  Guvf jvyy abj

    uryyb jbeyq

By the way, there is actually a piece of code which is not used in the original program! I leave it as an intellectual exercise to the reader to find out what it is.

Copyright © 1990, Landon Curt Noll & Larry Bassel. All Rights Reserved. Permission for personal, educational or non-profit use is granted provided this this copyright and notice are included in its entirety and remains unaltered. All other uses must receive prior permission in writing from both Landon Curt Noll and Larry Bassel.