Re: Fun - Each character at most once

"A. Pagaltzis" <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <20030717214851.GA2660@klangraum>
* [email protected] <[email protected]> [2003-07-17 21:15]:
> > What is the most "interesting" program that is restricted to
> > use each ASCII character at most once?
> 
> The definition I chose was to check if a program (from @ARGV)
> contains duplicate chars and  printing a duplicate char iff it
> has one.

Even ++, --, ==, && etc are illegal. A substitution based
approach is about impossible - you need a dot in several places
of the pattern, and if you have backreference you'll likely need
a capture variable with the same number in the replacement
expression as well. And finally, you can't refer to any variable
more than once.

That final one is the kicker.

Basically, with all ASCII characters used at most once, you can't
really write anything that needs to actually operate on data in
any more but the most trivial ways.

-- 
Regards,
Aristotle
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.