[Gllug] "easter egg" (?) in swi-prolog

Stig Brautaset stigbrau at online.no
Thu Oct 11 00:04:47 UTC 2001


* Nix <nix at esperi.demon.co.uk> spake thus:
> On Tue, 9 Oct 2001, Stig Brautaset spake:
> > Whilst playing around with swi-prolog for a course at uni, I managed to
> > find what I would call an easter egg. It's not hard to find though, but
> > it gave me a good laugh. At the prompt, type "TheUltimateAnswer."
> > without the quotes, then press enter.
> 
> Very, very silly.
> 
> You noticed the code for it in boot/toplevel.pl, I take it?

Heh, no, but thanks for the suggestion :) I'll use that :P

I simply played around with the Prolog interpreter, "asking it
questions" and suddenly I got the answer I was talking about. Of course,
Prolog being prolog, *any* variable would do (not just
TheUltimateAnswer). A variable in Prolog is anything that starts with a
capital letter, so simply typing "X" would do. 

Here is the output, for those that have not noticed it:

rwen:~$ prolog 
Welcome to SWI-Prolog (Version 3.3.0)
Copyright (c) 1993-1999 University of Amsterdam. All rights reserved.

For help, use ?- help(Topic). or ?- apropos(Word).

?- X. 
% ... 1,000,000 ............ 10,000,000 years later
% 
%       >> 42 << (last release gives the question)
?- % halt
Arwen:~$ 

*smile* 

Made me laugh at least. That's all I ask :) (sometimes)

Regards,
Stig

-- 
brautaset.org
Registered Linux User 107343

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list