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.
Cheers,
Keisuke Nakano <ksk _at_ mist.i.u-tokyo.ac.jp>
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
Cheers,
Loup
2008/1/28, Keisuke Nakano <k...@mist.i.u-tokyo.ac.jp>:
Till
On Jan 28, 2008 3:39 PM, Alain Frisch <al...@frisch.fr> wrote:
> Keisuke Nakano wrote:
> > 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.
>
> I've one with 0 bytes. Should I submit it?
>
> -- Alain
>
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
--
http://till-varoquaux.blogspot.com/
That makes 3 of us...
Keisuke
On 2008/01/29, at 0:37, Loup Vaillant wrote:
> You should have said the input must not be empty!
> It gave me false hopes :-(
>
On 2008/01/29, at 0:39, Alain Frisch wrote:
> Keisuke Nakano wrote:
>> 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.
>
> I've one with 0 bytes. Should I submit it?
>
> -- Alain
>
--
Romain Bardou
Till Varoquaux a écrit :
Are you thinking about a source that contains only 1 or two white
spaces? I can only think of whitespace
(http://compsoc.dur.ac.uk/whitespace/) to manage such a crazy feat.
<going_nuts>
Another idea: submit a single entry wich works as BOTH Ocaml and whitespace...
</going_nuts>
> Hello,
>
> 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.
Here's a new non-palindromic OCaml quine:
http://martin.jambon.free.fr/q.ml
Maybe not completely legal and works only "ocaml q.ml"...
but feel free to make it palindromic :-)
Martin
--
http://wink.com/profile/mjambon
http://martin.jambon.free.fr
Absolutely cool, lol !
Regards,
Fabrice
>> Here's a new non-palindromic OCaml quine:
>>
>> http://martin.jambon.free.fr/q.ml
>>
>> Maybe not completely legal and works only "ocaml q.ml"...
>>
>> but feel free to make it palindromic :-)
>
> Absolutely cool, lol !
But it's not a program.
Daniel
Yes it is!
Not a correct one, of course :)
--
Paolo
Paolo Donadeo, Senior Software Engineer
Studio Associato 4Sigma
Email: p.do...@4sigma.it
~
~
:wq
Daniel
Le 29 janv. 08 à 22:42, Paolo Donadeo a écrit :
>> But it's not a program.
>
> Yes it is!
>
> Not a correct one, of course :)
>
>
> --
> Paolo
>
>
> Paolo Donadeo, Senior Software Engineer
> Studio Associato 4Sigma
> Email: p.do...@4sigma.it
> ~
> ~
> :wq
_______________________________________________
Quite a cheating palindromic Quine, but that's enough for my being satisfied.
% cat t.ml
(*/*)()=()open Sys let tel()=();;let fer=print_string executable_name in tel
let ni eman_elbatucexe gnirts_tnirp=ref tel;;()=()let tel syS nepo()=()(*\*)
% O=`cat t.ml`; mkdir -p "(*"; ocamlc -w a t.ml -o "$O"; "$O"
(*/*)()=()open Sys let tel()=();;let fer=print_string executable_name in tel
let ni eman_elbatucexe gnirts_tnirp=ref tel;;()=()let tel syS nepo()=()(*\*)
% wc t.ml
2 16 154 t.ml
Explanation:
It just calls [print_string Sys.executable_name]
with an ad-hoc executable name.
Also, I've considered that ")(" and "/\" are palindromic.
Cheers,
Julien Moutinho.
Yeah, but I guess the constraint is that you have to run/process it in some
sort of what would normally be considered programming environment ;)
So, the error message approach, being a non-palindromic quine, will work with
many compilers in fact.
I guess the contest designers have to decide one way or the other on the "it
must be a correct program" constraint.
Cheers, Kuba
The only constraint for correctness is 'to be accepted by the server'.
The contest server automatically and immediately judges submitted
programs
whether it is correct or not. If the submission is correct, the
server will
add the author's name to the ranking.
The error message approach, even if it is palindromic, will be rejected
because the server does not observe the standard error.
Cheers,
Keisuke.
I guess that settles it, then. The approach was nifty, though ;)
Cheers, Kuba
On Wed, 30 Jan 2008 14:57:06 +0200, Kuba Ober <obe...@osu.edu> wrote:
> On Tuesday 29 January 2008, Bünzli Daniel wrote:
>> So your email below is a program ? You can define any string to be a
>> program but it won't be that useful.
> Yeah, but I guess the constraint is that you have to run/process it in
> some
> sort of what would normally be considered programming environment ;)
> So, the error message approach, being a non-palindromic quine, will work
> with
> many compilers in fact.
> I guess the contest designers have to decide one way or the other on the
> "it
> must be a correct program" constraint.
>
> Cheers, Kuba
________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Servers.
part000.txt - is OK
http://www.eset.com
open String;;(fun q s->let rec a s=let l=length s-1in if l>=0then(a
(sub s 1 l);print_char s.[0])in a s;print_string(q^s^q)) (make
1(char_of_int 34))"))43 tni_fo_rahc(1 ekam( ))q^s^q(gnirts_tnirp;s a
ni)]0[.s rahc_tnirp;)l 1 s bus( a(neht0=>l fi ni1-s htgnel=l tel=s a
cer tel>-s q nuf(;;gnirtS nepo"
Can anyone help to turn this into a proper palindrome?
Is it even possible to write a valid palindromic program in Ocaml, let
alone a palindromic quine?
William Blum
William Blum
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 <ksk _at_ mist.i.u-tokyo.ac.jp>
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.
_______________________________________________