Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some ludicrously short novel generators #81

Open
cpressey opened this issue Nov 29, 2021 · 1 comment
Open

Some ludicrously short novel generators #81

cpressey opened this issue Nov 29, 2021 · 1 comment
Labels

Comments

@cpressey
Copy link

This is a response to #69. An issue title like that sounds like a challenge, you know. A claim that deserves investigation, at least.

I would like to present for your entertainment a number of novel generators which are very short indeed.

Generator the First

To begin, here is a program written in the language HQ9+. It outputs the full lyrics to the rousing counting song "99 Bottles of Beer on the Wall", twenty-three times:

99999999999999999999999

Since this song has 25 words per verse, and 99 verses, and is output 23 times, a simple multiplication tells us that this program outputs 54648 words, which, in NaNoGenMo, is a novel. Here's a preview:

99 bottles of beer on the wall,
99 bottles of

(Alas, I can't bring myself to continue writing that out, much less post the entire thing. I suppose I will simply forego the 'completed' label on this one.)

You'll note that the program is only 23 characters long. Further, in the quite well-established ASCII encoding, the character 9 only occupies one byte, so this program can be expressed in only 23 bytes, as well.

Generator the Second

Though not as old as ASCII, HQ9+ is fairly well established as well -- it's 20 years old this year. However, if we are permitted to, as Lyxal has, make up a new language, I'm sure we can do better than 23 characters.

So, allow me to define the language HQ9N̅+. This is a variation on HQ9+ which enhances it in two small ways. First, it adds another instruction:

  • N: output 50,000 copies of the word "meow", separated by whitespace

Which means the following HQ9N̅+ program is a novel generator:

N

despite the fact that it's only 1 character long. Here's a preview: meow meow meow but again I will forego posting the entire output.

Generator the Third

But wait! Not done yet! The second enhancement to HQ9+, to which the overbar on the N in "HQ9N̅+" is clumsily alluding, is this rule:

  • A HQ9N̅+ program must have at least one instruction. If the HQ9N̅+ interpreter cannot find any instructions in the program, it supplies an N instruction as the default, and executes it.

Which gives us the following novel generator

of length zero.

I hope you enjoyed this little demonstration. We now return you to your regular computer-aided Oulipo jam, already in progress.

@hugovk hugovk added the preview label Nov 29, 2021
@hugovk
Copy link
Member

hugovk commented Nov 29, 2021

Lanmonster fixed the Q instruction and added the + instruction. Qh4os fixed the 9 instruction. Chris Pressey also fixed the 9 instruction.

https://esolangs.org/wiki/HQ9%2B

I particularly like that you fixed a 20-year-old language in preparation of this demo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants