From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=X_IP autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 82CDBBC6C for ; Fri, 8 Feb 2008 14:39:49 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPfqq0fAXQImh2dsb2JhbACQNQEBAQgKKZsw X-IronPort-AV: E=Sophos;i="4.25,321,1199660400"; d="scan'208";a="7822839" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 08 Feb 2008 14:39:49 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m18Ddmvp005318 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 8 Feb 2008 14:39:49 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAMrpq0eFC81lVGdsb2JhbACQKAMBGBabSA X-IronPort-AV: E=Sophos;i="4.25,321,1199660400"; d="scan'208";a="7099057" Received: from unknown (HELO mail5.ecc.u-tokyo.ac.jp) ([133.11.205.101]) by mail2-smtp-roc.national.inria.fr with ESMTP; 08 Feb 2008 14:39:47 +0100 Received: from mhs003.ecc.u-tokyo.ac.jp (mhs003.ecc.u-tokyo.ac.jp [133.11.70.163]) by mail5.ecc.u-tokyo.ac.jp (Postfix) with ESMTP id 95FD659F2B for ; Fri, 8 Feb 2008 22:39:43 +0900 (JST) Received: from [192.168.0.92] (220.110.80.17 [220.110.80.17]) by mhs003.ecc.u-tokyo.ac.jp (SpamBlock.pstn.b 3.4.102) with ESMTP id for ; Fri, 8 Feb 2008 22:39:32 +0900 Mime-Version: 1.0 (Apple Message framework v753) In-Reply-To: <4BD387EA-7017-494A-AF01-D8216EE22501@mist.i.u-tokyo.ac.jp> References: <4BD387EA-7017-494A-AF01-D8216EE22501@mist.i.u-tokyo.ac.jp> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Keisuke Nakano Subject: Re: [Caml-list] Palindromic Quine Date: Fri, 8 Feb 2008 22:39:31 +0900 To: caml-list@inria.fr X-Mailer: Apple Mail (2.753) X-IP: 220.110.80.17 X-FROM-DOMAIN: mist.i.u-tokyo.ac.jp X-FROM-EMAIL: ksk@mist.i.u-tokyo.ac.jp X-Miltered: at discorde with ID 47AC5BA4.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; u-tokyo:01 ocaml:01 cheers:01 u-tokyo:01 ocaml:01 23,:98 char:01 char:01 wrote:01 rec:01 exception:01 caml-list:01 string:02 bytes:03 bytes:03 The shortest code contest 'Palindromic Quine' is over. The result is found at: http://golf.shinh.org/p.rb?Palindromic+Quine#OCaml Finally I could find the shortest code with 199 bytes: "k\"",let rec(!)n?(q=String.make 1(Char.chr 34))s k=print_char (q^s^q^q^k^q).[abs n];!(n-1)s k in!99"99!ni k s)1-n(!;]n sba[.) q^k^q^q^s^q(rahc_tnirp=k s))43 rhc.rahC(1 ekam.gnirtS=q(?n)!(cer tel,""\k" It is an acceptable solution for the contest though the code execution ends with an exception 'index out of bounds'. There may exist a palindromic Quine code shorter than this code. Please try to find it if you're interested in. Cheers, Keisuke Nakano On 2008/01/29, at 0:23, Keisuke Nakano wrote: > A 'Palindromic Quine' code is now wanted by a shortest-code contest > at: > > http://golf.shinh.org/p.rb?Palindromic+Quine > > The code should be a Quine, which prints its own code without reading > its source file. Additionally, the code should be palindromic, which > reads the same forward as it does backward. Shorter code is better. > Lots of programming languages are available including OCaml, of > course. > > Please submit your palindromic Quine to the above contest if you > find it. > The deadline is Thursday, 7 February 2008, 16:46:39, GMT. > All submitted programs will be revealed after the deadline. > At present the shortest code in OCaml has 205 bytes.