Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdaisy.UUCP Path: utzoo!watmath!watnot!watdaisy!mpdevine From: mpdevine@watdaisy.UUCP (Michel P. Devine) Newsgroups: net.lang Subject: Polyglot Liar Challenge Message-ID: <7797@watdaisy.UUCP> Date: Tue, 1-Jul-86 22:21:06 EDT Article-I.D.: watdaisy.7797 Posted: Tue Jul 1 22:21:06 1986 Date-Received: Wed, 2-Jul-86 06:15:05 EDT Distribution: net Organization: U of Waterloo, Ontario Lines: 29 As I promised earlier, here is a program solving the 'liar' problem for C, Pascal and Fortran. It is a slight variation on the earlier solution. (*dumb), c; main() { puts ("Compiled by a C compiler"); } /*) program liar (* *) (output); (* *) begin writeln (* 1 ( *,* ) 'Compiled by a FORTRAN compiler' *) ('Compiled by a Pascal compiler'); end . (*/ #define end_pascal_comment *) Several people have responded with various solutions. It appears that this one is the 'cleanest' (if such a criterion is indeed valid, given the context :-) I have yet seen. Michel Devine ps The Unix f77 compiler under 4.2 BSD accepts '#' as a comment specifier, by the way. -- -------------------------------------------------------------------------------- mpdevine%watdaisy@waterloo.csnet (519) 884-7123 Michel P. Devine mpdevine%watdaisy%waterloo.csnet@csnet-relay.arpa CS Dept., U. Waterloo {allegra,decvax,inhp4,utzoo}!watmath!watdaisy!mpdevine Waterloo, Ont. N2L3G1