Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs

Dashboard
Notifications
Mark all as read
Challenges

Generate Lewis Caroll's Jabberwocky

+4
−0

The task is to generate the text of Lewis Caroll's Jabberwocky.

The text, quoted from Wikipedia, is as follows (I've replaced a non-ASCII character with ASCII, otherwise it's direct copy&paste from the linked Wikipedia article):

'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.

"Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!"

He took his vorpal sword in hand:
Long time the manxome foe he sought-
So rested he by the Tumtum tree,
And stood awhile in thought.

And as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came whiffling through the tulgey wood,
And burbled as it came!

One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.

"And hast thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!"
He chortled in his joy.

'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.

The text above has to be produced verbatim, including newlines (you can use any of the common newline characters or character sequences, provided you stay consistent). Note that there is a newline character at the end of the last line.

This is code-golf, so the shortest entry per language wins.

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

4 answers

+5
−0

Japt, 625 615 bytes

`'T°s ߍ¦g, „d e sҐy ‘vƒ
Did gyœ „d g‹½e ˆ e °¼;
A¥ Úßy ØÀ e ޒgovƒ,
A˜ e Ú  ÎÈs ŒtgŸ¼.
`
+i`
"BeØ e {=`Jab¼rwock`}, my s!
T” jaws È	 ßÒ, e claws È	 ¯t®!
BeØ e Jubjub bird, „d д
T” è–ムBÂrsn…®!"

He ‘ok –s vŽpal sÙ ˆ Ê@:
Lg ÈØ e µnxo´ foe ” Ñht-
So ΂ ” by e Tumtum ɇ,
A˜ ÐOd aؕe ˆ Èght.

A˜ † ˆ uff‰h Èght ” ÐOd,
T” {U}, ØP eyƒ  fla´,
Ca´ ²iffҁ È*ugh e tªgey wood,
A˜ ¿rÞB † Š ¯´!

Oš, two! Oš, two! A˜ È*ugh „d È*ugh
T” vŽpal Þue ØË sÍõ€-snack!
He ¤ft Š Ü%, „d ØP Šs Ê%
He ØË galumpʁ back.

"A˜ ÊQ È sÓ° e {U}?
Co´ ‘ my ‡ms, my ¼aÚÊ ¾y!
O fŸbjŒs »y! CÃ
oh! CÃy!"
He ֚t¤d ˆ –s joy.

-10 bytes thanks to @Shaggy

Dictionary compression, repeating the first paragraph. I can't really find any patterns to do anything else... words such as "Jabberwock" (which aren't in the dictionary) aren't compressed enough to try and save on, I think.

Test it

Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

[622](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=YCdUsHMg342mZywghGQgkGUgc9KQe... (3 comments)
+3
−0

Japt, 610 606 bytes

Don't think there's anything more that can be done with it than this.

933î`'T°s ߍ¦g, „d e sҐy ‘vƒ
Did gyœ „d g‹½e ˆ e °¼;
A¥ Úßy ØÀ e ޒgovƒ,
A˜ e Ú  ÎÈs ŒtgŸ¼.0"BeØ e 1, my s!
T” jaws È	 ßÒ, e claws È	 ¯t®!
BeØ e Jubjub bird, „d д
T” è–ムBÂrsn…®!"0He ‘ok –s vŽpal sÙ ˆ Ê@:
Lg ÈØ e µnxo´ foe ” Ñht-
So ΂ ” by e Tumtum ɇ,
A˜ ÐOd aؕe ˆ Èght.0A˜ † ˆ uff‰h Èght ” ÐOd,
T” 1, ØP eyƒ  fla´,
Ca´ ²iffҁ È*ugh e tªgey wood,
A˜ ¿rÞB † Š ¯´!0{`Oš, two! `²}A{22î`˜ È*ugh a`}
T” vŽpal Þue ØË sÍõ€-snack!
He ¤ft Š Ü%, „d ØP Šs Ê%
He ØË galumpʁ back.0"A˜ ÊQ È sÓ° e 1?
Co´ ‘ my ‡ms, my ¼aÚÊ ¾y!
O fŸbjŒs »y! CaÒoh! CÃy!"
He ֚t¤d ˆ –s joy.0`r0R² r1`Jab¼rwock

Test it

  • Everything between the backtick on the first line and the first backtick on the last line is the compressed poem with a few byte saving tricks:
    • The last stanza is omitted,
    • The double newlines are replaced with 0s, and,
    • The 3 occurrences of "Jabberwock" are replaced with 1s.
  • In addition to that there's some string interpolation on the 13th line, enclosed by the {}s:
    • The first one contains the compressed string "One, two!" between the backticks which the ² duplicates, and,
    • The second one contains the compressed string "nd through a" which the 22î repeats to length 22.
  • Then, at the end of that, we use r to replace the 0s with R (Japt's newline constant) duplicated and the 1s with the compressed string "Jabberwock".
  • Finally, the 933î at the very beginning repeats the final result to length 933.
Why does this post require moderator attention?
You might want to add some details to your flag.

0 comment threads

+2
−0

Bubblegum, 769 bytes

074cd1dc7fb6baed2f568915ffeb6aa5c775264a9a6f77eb418f0793da59b234599dadb6804269dbb5a213a05c807b0723f79512c284f46e8dbb6b0274f1b36606988b67ea58cf68beabe10f158702fcbf4c2b30d7b4f26190901aa713e125aee132d76940aff74588831a1908d8541c09f042556a7c7e24e80370734855cd398797d016c22627e54bec7c76034f141610fcbb8edb9ab6194c5914680b4c735f7a0e804b213dda7380469109d3a1296f04212cc5106e1282560971c3d4d357f330585209d924545a0e5180ccc1a01c8c65df7f29bb9fe3a5aeba8bf97781d60194f34bdfdbfc9aecfc49e8bd6896dc202d92830dd0ff31a115567bcec156ce21f705909b873eff8795764f24a6823f95b6c9548d2398cc1befecbf9298e3ec1211fea9615a9654746eb5defaafd70bd96ea6bff3d587ee01d7d631c5a613883afc25c7f9da67a7f185f19f3378d8790b173393344c2e66af508d63798be175f56178e5402ab07c8b97bc0c2c582010154a71c59acf175c4f2974b68cf319cace4de83e37d6d6f93b58f000033ed0accc7a742292780c5eb2fa87daa61a2e7794911787de40abed55f872483fa776e5d6158229577ec58b9a7b2e1f7c71930d8655491025808ceed9f960a4ecfcc69787bc965fc29852e77d6b6713b3e6d3b5e992d710a775464c9e3c7cc82d6bf7866f2b985e549a8b81dd5803f0746cd41dbe5f016d65f40f1efc4aa7ea204e73f9c47a9c2f9ce9b5d46b018c0bc2d68ae15635fa967be70cd7cc9d47a62da62e0546ae68a912cae2408e4c9b5dbeddb218cc3c70c69f11175cdc61c8a7422d50bb8038fcbd7d9dff05bdd821931c0e083a9f4f509b776106219099f616a8a439d12491bff97f31222881cbafe273680ae34d59ca5536f25c308e6402b31191d235bbfdcfa4bb681410c0d84c0f1f4d008b591ddc7d3d2c32c9da15554d51a6355686eb9afe64c45f96a5f83dbae78545b9daf1118e600878eadec76d3a26cee9ed3e817b4be1d7e95380ab13c6d2a32cea2370208925c736e41288a04658380d6e86cb07ed7b08e2c8efa76234fb18e3b25e00                                            .

Try it online!

Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

General comments (3 comments)
+1
−0

Python 3, 874 bytes

a="'Twas brillig, and the slithy toves\nDid gyre and gimble in the wabe;\nAll mimsy were the borogoves,\nAnd the mome raths outgrabe.";b="he Jabberwock";c="Beware t";d="One, two!";e="nd through";f="\n\n";g="vorpal"
print(a+"\n\n\""+c+b+", my son!\nThe jaws that bite, the claws that catch!\n"+c+"he Jubjub bird, and shun\nThe frumious Bandersnatch!\"\n\nHe took his",g,"sword in hand:\nLong time the manxome foe he sought-\nSo rested he by the Tumtum tree,\nAnd stood awhile in thought.\n\nAnd as in uffish thought he stood,\nT"+b+", with eyes of flame,\nCame whiffling through the tulgey wood,\nAnd burbled as it came!"+f+d,d,"A"+e,"a"+e+"\nThe+",g,"blade went snicker-snack!\nHe left it dead, and with its head\nHe went galumphing back.\n\n\"And hast thou slain t"+b+"?\nCome to my arms, my beamish boy!\nO frabjous day! Callooh! Callay!\"\nHe chortled in his joy.\n\n"+a)

Try it online!

This was way faster to deal with than "99 Bottles of Beer" to be completely honest.

Why does this post require moderator attention?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!

Like what we're doing? Support us! Donate