Lipograms in Java

W

Wibble

Roedy said:
I presume you are doing some sort of unmaintainable code trick

int condition = 1;
//...
if (1==condition) {

}
if !(1==condition) {

}

but that is not compilable java.
It appears to involve ignoring return values and ternary operations,
kinda like anti-functional programming.

I think before it was called lipograms it was just called stupid.
 
B

Bent C Dalager


It is not clear which "sounds" you are trying to avoid. Or is it meant
as a general how-to for excluding any arbitrary sound?

If so, I would consider organizing the document into one chapter per
keyword, as keywords is the main thing you need to worry about. I
would guess that the most annoying words would be "public", "class",
"static", "void", "main" and "String". Others, like "import" are
trivially avoided.

Another topic of some interest might be how to handle the symbols of
the standard API (just in case you want the program to also do
something useful).

A more painless way to achieve this might be to start using a
preprocessor and just #define away your unwanted sounds, but that's a
bit like cheating :)

Cheers
Bent D
 
R

Ross Bamford


:D Like it.

A few here appear to have missed the point - it's a game, or something to
do to exercise your creativity a bit. See if you can write programs
without using one or more standard constructs. In literature, it's often
about writing text (sometimes whole books) without using the letter 'e',
and just think what that precludes from your java code (else, new, return,
etc).

(Aside: Try doing a 'find' for 'e' in the entire article text, source and
all)
 
T

Tris Orendorff

I assume the letter you try to avoid is "e", but you don't say so
anywhere. That makes the choices look somewhat arbitrary.

I don't think that is possible since the body of the article is a lipogram
as well. It is written without the letter 'e'.


--

Sincerely,

Tris Orendorff
[Two antennae meet on a roof, fall in love and get married. The ceremony
wasn't much, but the reception was excellent.]
 
C

Chris Uppal

According to Tris,
I don't think that is possible since the body of the article is a lipogram
as well. It is written without the letter 'e'.

It could say:

A hint: writing and programming with only consonants, punctuation,
and 'a' 'i' o' and 'u' [*], is not as straightforward as you might think.

([*] Got it ? No ?? Ok, try a /BIG/ hint: 'a' 'i' o' and 'u' -- spot
anything missing ?)

Or it could cut out any crap and just say it straight:

This wbpag was writtn without using th lttr ''.

-- chris
 
B

Bent C Dalager

I don't think that is possible since the body of the article is a lipogram
as well. It is written without the letter 'e'.

It is always possible to refer to it indirectly, as the "fifth glyph",
perhaps.

In a sad twist, though, the URL offered isn't a lipogram.

Cheers
Bent D
 
B

Bent C Dalager

(Hmm, this lipogram stuff is difficult!)

Yeah, I noticed. I figured out pretty soon, though, that if I were to
write an "e" lipogram, I couldn't even sign it with my own name and so
I dropped it :)

If you ignore the headers though, this post _is_ a lipogram for the
last letter in the English alphabet :)

Cheers
Bent D
 
P

Pawel Slusarz

Bent said:
In a sad twist, though, the URL offered isn't a lipogram.

Sad, indeed, but it's legal by the form's rules. So is including the
offending letter in the author's name, colophon, and anything else that goes
with the publishing business. At least I didn't see any effort to censor
these in the copy of 'A Void' that I saw.

Paul
 
O

Oliver Wong

Pawel Slusarz said:

Very amusing.

I tried figuring out how to do I/O, but came up with nothing. Dead ends
included:

* use static imports to get the static operations of System without
actually mentioning System. Unfortunately, the static import itself mentions
System.
* Throwing some sort of exception whose name doesn't contain 'e', while
setting its message to the desired output. Unfortunately, you have to
instantiate an exception before you can throw it.
* Instantiating an Exception (or anything else) use Class.forName().
Unfortunately, this method throws an exception, which you must catch (and
thus mention), and the exception, and all of its parents, has 'e' in its
name.
* Declaring and using annotations for something. I'm don't have much
experience with annotations, so I have no idea what kind of tricks could be
done with these.

Of course, you could "cheat" and use \u0065 whereever you wanted to use
'e' but that would probably defeat the spirit of the challenge.

- Oliver
 
C

Chris Uppal

Oliver said:
I tried figuring out how to do I/O, but came up with nothing. Dead
ends included:

I also pondered using classloader trickery and bytecode rewriting, but first
you have to create your classloadEr :-(

OTOH, lipogram classfiles would have their own challenges. Obviously one would
have to disallow any bytecode with an E in its hex code:
arraylength
astore_3
d2i
dconst_0
dup2_x2
fdiv
freturn
iaload
iand
ifle
istore_3
lload_0

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top