Derek,

To make life interesting we need a new rule:
Identifiers can only be one character long.


and to remove the obvious answers like x++

we need a rule that requires more than two kinds
of token, or perhaps a rule against this kind of
puzzle ;-)


L.

Sent from my iPhone

On 28 Aug 2009, at 19:39, "Derek M Jones" <de...@knosof.co.uk> wrote:

Frank,

What about thinking up symmetric expressions, e.g.,

  (p)++|++(q)

or:

    l<-o->l

Anybody got some more eye twisters?

or trying to figure out how how to write the expression
containing the highest percentage of any character.  For
instance, a ( or ) each make up 3/7 of the following
expression.

   (((a)))

I know of one expression that is made up of 2/3 of one
particular character.

Can anybody do better?


All of the above are syntactically correct (well at last
after adding a semicolon and and enclosing function definition
and it is possible to create declarations for the variables to
make them acceptable to a strictly conforming C/C++ translator.

--
Derek M. Jones                         tel: +44 (0) 1252 520 667
Knowledge Software Ltd                 mailto:de...@knosof.co.uk
Source code analysis                   http://www.knosof.co.uk



--
Derek M. Jones                         tel: +44 (0) 1252 520 667
Knowledge Software Ltd                 mailto:de...@knosof.co.uk
Source code analysis                   http://www.knosof.co.uk

Reply via email to