> [EMAIL PROTECTED] On Behalf Of Boyko Bantchev
> 
> On 5/16/07, June Kim <[EMAIL PROTECTED]> wrote:
> > My original ideas was printing only the codes on the T-shirt.
> >
> > However, displaying the result of the code together might be a good
idea,
> too.
> 
> You can have both at once if you use a quine,
> such as  http://www.nyx.net/~gthompso/self_j.txt
> (although this particular phrase hardly shows anything
> very interesting or distinguishing of J).

Josh's's above referenced expression is both, a J Quine (it displays
itself),

   ".a=.'''".a=.'',q,q,~a#~1+a=q=.39{a.'
".a=.'''".a=.'',q,q,~a#~1+a=q=.39{a.'

and a J (self-contained) self-reproducing expression ((-: ".) holds true for
the expression),

   (-: ".) ".a=.'''".a=.'',q,q,~a#~1+a=q=.39{a.'
1

However, it does not exhibit J conciseness (which, to be fair, might not
have been a goal).

I often find entertaining, given an expression, to search for the shortest
equivalent expression, for example, the shortest (self-contained) expression
for:

0.      A self-reproducing expression (SRE)
1.      Quine
2.      A self-reproducing expression that is also a Quine

My efforts follow bellow [spoiler alert!]:












































0. The shortest SRE to type: ''
   (-: ".) ''
1

If the tally of the expression is used as the metric then '' is also a
winner

   # ''
0

together with its myriads of siblings (e.g., Roger's i.0 0
http://www.jsoftware.com/pipermail/general/2001-February/005378.html ).

1. Although Dan Bron's 0 (see, http://www.jsoftware.com/jwiki/Puzzles/Quine
), or any of its siblings, is short enough; I would argue that an empty line
is, clearly, the shortest Quine:

   
   

The above J Quine is a testament of J conciseness compared to the other
solutions in http://www.nyx.net/~gthompso/quine.htm .  I have used, and will
use, continuously this handy multi-purpose program in almost every J
session. One can find almost anywhere T-shirts that display it in the front
or back (or both) and have been wearing them since I was a baby.  

2. Notwithstanding "emptiness is enlightenment" I am still puzzled about the
shortest self-reproducing expression that is also a Quine (i.e., the
shortest non-empty SRE?).  My best effort (and I am giving up) is,

   (,~,2#{:)'(,~,2#{:)'''
(,~,2#{:)'(,~,2#{:)'''

   (-: ".) (,~,2#{:)'(,~,2#{:)'''
1

   # (,~,2#{:)'(,~,2#{:)'''
22

which follows the pattern,

   (,{:)^:2,~'expression'''
expression'expression'''

favored by Andrew Nikitin (see, the link above).



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to