18
\$\begingroup\$

I remember people saying that code size should be measured in bytes, and not in characters, because it's possible to store information with weird Unicode characters, which have no visual meaning.

How bad can it be?

In this challenge, you should output the following Lorem Ipsum text, taken from Wikipedia:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Please specify the number of characters (not bytes) in your code. Code with the minimal number of characters wins.

Your code should only contain valid Unicode characters, as described here, that is:

  • Code points up to U+10FFFF
  • No surrogates (the range D800–DBFF is forbidden)
  • No characters FFFE and FFFF
  • No null characters (code 0)

If your code cannot be displayed, provide a version with offending characters redacted, and a hexdump.

Some notes:

  • The output must be one long line (445 characters). If your system cannot do that (e.g. you're printing it on paper), output a closest approximation. Trailing linebreaks don't matter.
  • Built-in functions that generate Lorem Ipsum text are not allowed
  • Please specify a valid text encoding for your code, if relevant
\$\endgroup\$
15
  • 3
    \$\begingroup\$ Sadly =lorem() in MS Word doesn't output the right version \$\endgroup\$
    – BlackCap
    Sep 8, 2016 at 16:18
  • 4
    \$\begingroup\$ 3 answers so far specifying bytes. Methinks some people may not have read the challenge \$\endgroup\$ Sep 8, 2016 at 16:57
  • 1
    \$\begingroup\$ Is it permitted to make an http request? \$\endgroup\$
    – Master_ex
    Sep 8, 2016 at 18:05
  • 2
    \$\begingroup\$ This feels like a dupe of the this challenge as there aren't any patterns in the text? \$\endgroup\$ Sep 8, 2016 at 19:05
  • 1
    \$\begingroup\$ code-golf also covers shortest code by characters (see point 7 in the requirements list of the tag info). This is code golf, and thus it's still a dupe, since there aren't any patterns to exploit. \$\endgroup\$
    – user45941
    Jan 17, 2017 at 16:25

16 Answers 16

14
\$\begingroup\$

JavaScript (ES7), 326 283 273 249 243 242 chars

_=>"򾍮󂙙󱤭󕜛񟉝񚫎󸦘󏇌󻮾󪕍򦙜񴫰𭙝𧇍񛜃򧮖󓔽򅬸󪙗񴦲񿫽񟮩򺥸󫡽񛜕󖷉󂨗񢕕򦯊񗮣󌫉񣔶򥹖񟷗򢫂󧩜񝼜󾿍񙇛񴮪󼬗񟪵񥦘񝕋󖹜񝹜򢟝񚪲󧩙񙁪񛌖󆆸񛌗󳭞񧔍􄮉񧮮񜭾󫤭󕜛񜫩󫬻򄗗񻭲󺙗񟼕􆞪󻤿򅙝𯎎񛉕򹤭󕜛򀿉򏨒񧔷􅚪񞕛򢮾󪂌򆞮􆴼򥾩󓆊򃅝񛏙򣕝񧔷󕴹󮉍򅾢󷫽񜫩񷪹񢝞򢜏򌦒񢖮󳭾󏔶󕚲󺕗򥤲񸾝񝕋󖿇"[r='replace'](/./gu,c=>(c.codePointAt()-4**8).toString(32))[r](/\d/g,d=>"  , exum. ".substr(d,2))[r](/^.|\. ./g,x=>x.toUpperCase())

How it works

The first step in my compression technique is to convert the whole string to lowercase (not mandatory, but looks better), and replace each pair of chars in , exum.  (as well as the trailing space by itself) with its index in the string plus 2. This makes the text a valid base-32 number:

lorem9ips69dolor9sit9amet2consectetur9adipiscing3lit2sed9do3iusmod9tempor9incididunt9ut9labore3t9dolore9magna9aliqua8ut3nim9ad9minim9veniam2quis9nostrud94ercitation9ullamco9laboris9nisi9ut9aliquip943a9commodo9consequat8duis9aute9irure9dolor9in9reprehenderit9in9voluptate9velit3sse9cill69dolore3u9fugiat9nulla9pariatur84cepteur9sint9occaecat9cupidatat9non9proident2sunt9in9culpa9qui9officia9deserunt9mollit9anim9id3st9laboru7

The next step is to convert each 4-char run to decimal, then get the character at that code point. This can be done with the following function:

f=s=>s.replace(/..../g,x=>(n=parseInt(x,32),String.fromCharCode(0xD800+(n>>10),0xDC00+(n&0x03FF))))

(Note: Since all digits are 2 or greater, the minimum possible value of four digits is 2222₃₂. This is equal to 95978₁₀, or 176EA₁₆; therefore, code points will never be in the restricted range.)

And now we have our compressed string:

򾍮󂙙󱤭󕜛񟉝񚫎󸦘󏇌󻮾󪕍򦙜񴫰𭙝𧇍񛜃򧮖󓔽򅬸󪙗񴦲񿫽񟮩򺥸󫡽񛜕󖷉󂨗񢕕򦯊񗮣󌫉񣔶򥹖񟷗򢫂󧩜񝼜󾿍񙇛񴮪󼬗񟪵񥦘񝕋󖹜񝹜򢟝񚪲󧩙񙁪񛌖󆆸񛌗󳭞񧔍􄮉񧮮񜭾󫤭󕜛񜫩󫬻򄗗񻭲󺙗񟼕􆞪󻤿򅙝𯎎񛉕򹤭󕜛򀿉򏨒񧔷􅚪񞕛򢮾󪂌򆞮􆴼򥾩󓆊򃅝񛏙򣕝񧔷󕴹󮉍򅾢󷫽񜫩񷪹񢝞򢜏򌦒񢖮󳭾󏔶󕚲󺕗򥤲񸾝񝕋󖿇

That's 445 chars compressed into 106 chars. The decompression simply reverses this process:

  1. Convert each char to its code-point in base-32, minus 65536.
  2. Replace each digit n with " , exum. ".substr(n,2).
  3. Convert each letter after a period or at the beginning of the string to uppercase.

The only ES7 feature used is **. Replace 4**8 with 65536 to run in a browser that doesn't yet support ES7.

\$\endgroup\$
2
  • \$\begingroup\$ If you use ES7, you could use 4**8 instead of 65536. \$\endgroup\$
    – mbomb007
    Jan 17, 2017 at 17:50
  • \$\begingroup\$ @mbomb007 Thanks. Perhaps that will come in handy in other challenges too \$\endgroup\$ Jan 17, 2017 at 18:09
8
\$\begingroup\$

Dyalog APL, 123 characters

All but the final period are packed into 111 32-bit characters (UTF-32).

'.',⍨80⎕DR'𦽌򒁭󗕳󆽤𲁲𒁴󇑥󦽣񆍥𧕴򖑡𷍩􆝮񆥬񗌠󶐠񖥥񆽭󖕴􇉯򖍮񖑩񒁴𖰠񗉯􇑥󶱯󒁥𖹧򖱡󦅵􇑕󖥮􆑡򖹩񗘠󖅩񗄠󢁳𧑳񒁤𷉥񆅴􆹯𖱬􆽣󶉡􇍩򗍩􇑵𖥬􇁩񒁸󶌠񆽭󶌠𖕳󧑡򗕄񖄠򒁥񗉵󆽤򒁲񗈠򆕲񖑮􇑩񢁮􇕬񗑡󆕶񒁴􆕳󆱩񂁭𦽬񖔠񷕦􇑡󆱵𗀠񆅩􂹲񖍸񖕴򗌠󲁴񖅣􇑡򗁵𗑡󶸠𧀠񖑩􂱴񆹵􆹩􆱵񗄠񦼠򖍩񖐠񗉥󒁴򖱬󦄠򒁭𶔠𖰠񗉯'

'.',⍨ period appended to

80⎕DR the 8-bit (8) character (0) Data Representation of

'...' the 111 Unicode characters U+26F4C 9206D D7573 C6F64 32072 12074 C7465 E6F63 46365 27574 96461 37369 10676E 4696C 57320 F6420 56965 46F6D D6574 10726F 9636E 56469 52074 16C20 5726F 107465 F6C6F D2065 16E67 96C61 E6175 107455 D696E 106461 96E69 57620 D6169 57120 E2073 27473 52064 37265 46174 106E6F 16C6C 106F63 F6261 107369 97369 107475 1696C 107069 52078 F6320 46F6D F6320 16573 E7461 97544 56120 92065 57275 C6F64 92072 57220 86572 5646E 107469 6206E 10756C 57461 C6576 52074 106573 C6C69 4206D 26F6C 56520 77566 107461 C6C75 17020 46169 102E72 56378 56574 97320 F2074 56163 107461 97075 17461 F6E20 27020 56469 102C74 46E75 106E69 106C75 57120 66F20 96369 56420 57265 D2074 96C6C E6120 9206D 36520 16C20 5726F, which all fall in the range 12074–10756C and thus inside the OP's all-permitted range 10000–10FFFF.

\$\endgroup\$
8
\$\begingroup\$

bash + coreutils + gzip + recode, 191 characters

echo -ne "ᾋࠀ㰟퍗\03㖐셱䌱ࡄ戋⪒宮⦀⃬〣ख़ʏ쬏湂삲מּ浊莎ᔍ얪䴬畐Ꮏ肭⽡តप㩴뇶ᮤ樶鞔岀梬昅⹭盖ꈥ먣Ვ빓ỢꞴꃑ괓꣪㷨삗䎺뛔䛓ﵸ摉篨䊷૤⦓헉픺ꉖ橬ꟲỒꗻ퉋則ใ⢍럴摧耼񸺷⒅୴䘺㦳櫇鐱窑駁愵䚞鎴鍉Ⅻक़毽➔脂ힸ⤹喝葁㎋頇㺞ⳃ┶왤惌⒜猜䌋吏젔掚ᛩ鯢⚕䜹鴛皽⨫ꇈ銹믍䄛逦軵융󌒣杻龇븁\0"|recode u8..utf16be|tr -d ٣ܣ|gunzip

The string is the gzip of the text interpreted as UTF-16BE, plus a few extra bytes to pair with the unpaired surrogate halves. The tr strips off the extra surrogate halves.

This script file (or the shell into which this command is typed) should interpret text as UTF-8, which is why the recode is needed.

\$\endgroup\$
4
  • \$\begingroup\$ Welcome to PPCG! Nice first post! However, we count things in bytes here. Sorry. \$\endgroup\$
    – Riker
    Sep 9, 2016 at 22:14
  • 6
    \$\begingroup\$ This question makes an explicit exception to that, stating "Please specify the number of characters (not bytes) in your code," and discussing which Unicode characters are allowed. \$\endgroup\$
    – user59468
    Sep 9, 2016 at 22:23
  • 1
    \$\begingroup\$ I'm... an idiot. Sorry about that. >_> \$\endgroup\$
    – Riker
    Sep 9, 2016 at 22:24
  • 2
    \$\begingroup\$ No problem, I bet the bytes–characters thing is a common mistake on other questions. \$\endgroup\$
    – user59468
    Sep 9, 2016 at 22:33
8
\$\begingroup\$

Javascript (ES6), 261 255 254 characters

Saved 1 byte, thanks to ETHproductions

_=>'L'+"⫒㠰拳␰䨒堵̎⨦W䙨ⅶ嵷˘㥆姳䗨⠬巯堡Ŋɩ懪䨶尩个˒≎㥎䜩怷㰷䤆ŵ̊㹩⫒ᨠᩌ㳠抮f̅㩊ᠰ䀩㩎搰㩊ئ抠ˮ婱拗⠩啺巨㬆ɒ㸘∦㰲䤆姵㩀Ƕ̘㨆㬴⠳⠺…䈲䥒䤠⫱᬴w㬣ᠶ⬘嗠⫘䥀噯䗠⫀⫓䕭啩̎Ɏ㹹庘⬆⭀巯奠Ŷ㷨䌯䥀噯⠪ⰸ㦸̆㼱ï哳峮૘梠䵨慷堵幎≠⣨峨愠◳ᬆ䐷ɒ䫓⥎ܑ拠̑Ɏ㼨ó㬴⹠⇫î奩拊̑㹰巯䓠ȮŎ廪ᨀ噧ਸ".replace(/./g,c=>(s=" ,.DEUabcdefghilmnopqrstuvx")[(c=c.charCodeAt()-32)&31]+s[c>>5&31]+s[c>>10])

Breakdown

Payload: 148 Unicode characters
Code: 107 bytes

How it works

We first remove the leading 'L' from the original message so that we're left with 444 = 148 * 3 characters.

Without the leading 'L', the character set is made of the 27 following characters:

" ,.DEUabcdefghilmnopqrstuvx"

Each group of 3 characters is encoded as:

n = 32 + a + b * 32 + c * 32^2

where a, b and c are the indices of the characters in the above character set.

This leads to a Unicode code point in the range U+0020 to U+801F, ending somewhere in the "CJK Unified Ideographs".

let f =
_=>'L'+"⫒㠰拳␰䨒堵̎⨦W䙨ⅶ嵷˘㥆姳䗨⠬巯堡Ŋɩ懪䨶尩个˒≎㥎䜩怷㰷䤆ŵ̊㹩⫒ᨠᩌ㳠抮f̅㩊ᠰ䀩㩎搰㩊ئ抠ˮ婱拗⠩啺巨㬆ɒ㸘∦㰲䤆姵㩀Ƕ̘㨆㬴⠳⠺…䈲䥒䤠⫱᬴w㬣ᠶ⬘嗠⫘䥀噯䗠⫀⫓䕭啩̎Ɏ㹹庘⬆⭀巯奠Ŷ㷨䌯䥀噯⠪ⰸ㦸̆㼱ï哳峮૘梠䵨慷堵幎≠⣨峨愠◳ᬆ䐷ɒ䫓⥎ܑ拠̑Ɏ㼨ó㬴⹠⇫î奩拊̑㹰巯䓠ȮŎ廪ᨀ噧ਸ".replace(/./g,c=>(s=" ,.DEUabcdefghilmnopqrstuvx")[(c=c.charCodeAt()-32)&31]+s[c>>5&31]+s[c>>10])


console.log(f())

\$\endgroup\$
0
5
\$\begingroup\$

05AB1E, 319 bytes

Uses CP-1252 encoding.

•9y†QHÚSe²ŒÓdéÓ#ǧÖN›Íˆž4GÏóREØån‡·JîÁØ£ÎÁ¥evÑRZ¶—¥1RËÒÆzçå"UNé¨v¯ÊcŒÔÝjðtrœÛeã&“SÁxÌ4Þá1N$ù?T(çÛbŸœfó˜lUž}Þß-©ÃMšBÈÑPàê#jÇÐ+n¼BDFý>–¸äFT×›qÜY³ö9ªòËùˆA‡¾p=‘¤ÚÞ{I¶Œ±Ål#¨5´Aq˜Àž,s<*Ï;‡õã¾»ðŽL´ÅuØö+Xi+S>»/8Kã~WΔƒß”¤µðWluØa'cUÐeà¥ä…ž+œ6*0RU£›aÝQ_ñœoþÏð””Þã7ã¨sŒV`_É-´éÄèÆd¦úE5Í^Aá,‘‡™™¢äTHä0¥3±.}Søg•36B0„. :™J'yð:'z',:'.«

Interpret the following string as a base 36 number and encode into base 214

LOREMYIPSUMYDOLORYSITYAMETZYCONSECTETURYADIPISCINGYELITZYSEDYDOYEIUSMODYTEMPORYINCIDIDUNTYUTYLABOREYETYDOLOREYMAGNAYALIQUA0UTYENIMYADYMINIMYVENIAMZYQUISYNOSTRUDYEXERCITATIONYULLAMCOYLABORISYNISIYUTYALIQUIPYEXYEAYCOMMODOYCONSEQUAT0DUISYAUTEYIRUREYDOLORYINYREPREHENDERITYINYVOLUPTATEYVELITYESSEYCILLUMYDOLOREYEUYFUGIATYNULLAYPARIATUR0EXCEPTEURYSINTYOCCAECATYCUPIDATATYNONYPROIDENTZYSUNTYINYCULPAYQUIYOFFICIAYDESERUNTYMOLLITYANIMYIDYESTYLABORUM

After that we

36B                      # encode back into base 36
   0„. :                 # replace 0 with ". "
        ™J               # convert to titlecase and join
          'yð:           # replace "y" with <space>
              'z',:      # replace "z" with ","
                   '.«   # add a "." at the end

For some reason the encoding didn't work with a 0 at the end which is why need a special case for the final ".".

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ I think you can replace Y and Z by 1 and 2 and save a few bytes. Also maybe rearrange the 0, 1 and 2 to get rid of the mysterious special case? \$\endgroup\$
    – anatolyg
    Sep 8, 2016 at 18:40
  • \$\begingroup\$ @anatolyg: unfortunately no. Any non-letter counts as a word break, which would mess with the title casing. \$\endgroup\$
    – Emigna
    Sep 9, 2016 at 2:53
5
\$\begingroup\$

PHP ,247 Characters

combination of the 2 previous versions

echo gzuncompress(base64_decode(mb_convert_encoding("敊眱歍䙸兺䕉剆癚䅪礯極南慷潧楏㡷䥷汚䅯⽌䐸灐扫䱁獶猫扅煄橨啎硡灎䱈噑䔷⭂牓㥨䘴㡊䭪瀰獦夷灇漲氵剣杇楳婧啵扥卹摴慩䩢潪䡊圫啨㝩氷卧ぢご煏潪㙍䍮儷焲ㅅ扔⽘桭卥㉇别桃琫啺䍵公欹塊ㅔ煩噭灳氯䥥ぱ堷ぱ⭫橨祇啂灶㙣浵䅈湋䐷硴卑潘㙉砰捭塖橩汪祲昰䥪佄㔸晔慯眸䨲歮欰䱗䕲䑗⭫㡯䅷塏畃猵⭪慅兔佌流晥塹穄䩔扇婇䑍䩊硺䡅䵌⭤㝉䙇佡䙵浢㑩慖剺湱潊ぢ摰㝋卩楹婏㕵猷灴ぁ慫楗倹捙ㄲ⽁䍧塋啊","UTF-16")));

PHP, 261 Characters

echo mb_convert_encoding("䱯牥洠楰獵洠摯汯爠獩琠慭整Ⱐ捯湳散瑥瑵爠慤楰楳捩湧⁥汩琬⁳敤⁤漠敩畳浯搠瑥浰潲⁩湣楤楤畮琠畴慢潲攠整⁤潬潲攠浡杮愠慬楱畡⸠啴⁥湩洠慤楮業⁶敮楡洬ⁱ畩猠湯獴牵搠數敲捩瑡瑩潮⁵汬慭捯慢潲楳楳椠畴⁡汩煵楰⁥砠敡⁣潭浯摯⁣潮獥煵慴⸠䑵楳⁡畴攠楲畲攠摯汯爠楮⁲数牥桥湤敲楴⁩渠癯汵灴慴攠癥汩琠敳獥⁣楬汵洠摯汯牥⁥甠晵杩慴畬污⁰慲楡瑵爮⁅硣数瑥畲⁳楮琠潣捡散慴⁣異楤慴慴潮⁰牯楤敮琬⁳畮琠楮⁣畬灡ⁱ畩晦楣楡⁤敳敲畮琠浯汬楴⁡湩洠楤⁥獴慢潲畭.","UTF-16");

Encoding $s contains the string

foreach(str_split(bin2hex($s),4)as $c)eval('echo"\u{'.$c.'}";');

Old Version PHP , 386 Bytes|Characters

echo gzinflate(base64_decode("NZDBcUMxCERb2QI8v4rklmsKIIjvMCMJWQKPyw/KT25CwLL7PmxKg44VDcWqTSx1UBO/ga0vYRePCSo6dLH2O6RqNpeUXIBorGYFLm3ksnbWoiW6IxyVvlIe4pe0oNG9E6jqI+jAp0O6ttRG0/14ZknthkfoQrflMwrkJZPVydU6olZqbJfyHtKl+9KvpI4chlAab+nJrgB5yg+8bUkKF+iMdHJl1Y4pY8q39CIzg+fH02qMPCdpJ5NC1hKw1vpPKAMFzrgrOfo2hEEzi5gH3l8swyU2xmRgzCSccxxDC/neyBRjmhbpm+ImlUc56qCdG3aeykoosmTubrO6bdAGpIlj/XGNdvwA"));
\$\endgroup\$
4
\$\begingroup\$

C#, 337 333 331 characters

_=>{var q="";foreach(var c in"潌敲彭灩畳彭潤潬彲楳彴浡瑥弬潣獮捥整畴彲摡灩獩楣杮敟楬ⱴ獟摥摟彯楥獵潭彤整灭牯楟据摩摩湵彴瑵江扡牯彥瑥摟汯牯彥慭湧彡污煩慵弮瑕敟楮彭摡浟湩浩癟湥慩Ɑ煟極彳潮瑳畲彤硥牥楣慴楴湯畟汬浡潣江扡牯獩湟獩彩瑵慟楬畱灩敟彸慥损浯潭潤损湯敳畱瑡弮畄獩慟瑵彥物牵彥潤潬彲湩牟灥敲敨摮牥瑩楟彮潶畬瑰瑡彥敶楬彴獥敳损汩畬彭潤潬敲敟彵畦楧瑡湟汵慬灟牡慩畴ⅲ䕟捸灥整牵獟湩彴捯慣捥瑡损灵摩瑡瑡湟湯灟潲摩湥ⱴ獟湵彴湩损汵慰煟極潟晦捩慩摟獥牥湵彴潭汬瑩慟楮彭摩敟瑳江扡牯浵ਡ")q=q+(char)(c&255)+(char)(c>>8);return q.Replace("!",".").Replace("_"," ");};

-4 characters by replacing the .s after "pariatur" and "laborum" with ! before combining the chars to wide chars and adding a trailing new line.

-2 characters by re-assigning the output var rather than appending with +=.

How it works:

The lorem ipsum string was converted to that mess by replacing . with !, with _ so when the ascii chars are placed next to each other to make a wide char each wide char is a single character.

/*Func<object, string> Lorem = */ _=> // unused parameter
{
    // Output var
    var q = "";

    // Enumerate each wide char
    foreach (var c in "潌敲彭灩畳彭潤潬彲楳彴浡瑥弬潣獮捥整畴彲摡灩獩楣杮敟楬ⱴ獟摥摟彯楥獵潭彤整灭牯楟据摩摩湵彴瑵江扡牯彥瑥摟汯牯彥慭湧彡污煩慵弮瑕敟楮彭摡浟湩浩癟湥慩Ɑ煟極彳潮瑳畲彤硥牥楣慴楴湯畟汬浡潣江扡牯獩湟獩彩瑵慟楬畱灩敟彸慥损浯潭潤损湯敳畱瑡弮畄獩慟瑵彥物牵彥潤潬彲湩牟灥敲敨摮牥瑩楟彮潶畬瑰瑡彥敶楬彴獥敳损汩畬彭潤潬敲敟彵畦楧瑡湟汵慬灟牡慩畴ⅲ䕟捸灥整牵獟湩彴捯慣捥瑡损灵摩瑡瑡湟湯灟潲摩湥ⱴ獟湵彴湩损汵慰煟極潟晦捩慩摟獥牥湵彴潭汬瑩慟楮彭摩敟瑳江扡牯浵ਡ")
        // Split each wide char into two ascii chars
        q = q + (char)(c&255) + (char)(c>>8);

    // Restore the replaced periods and spaces
    return q.Replace("!",".").Replace("_"," ");
};
\$\endgroup\$
3
\$\begingroup\$

ISOLADOS, 44016 bytes

http://pastebin.com/raw/Y2aAhdpi

Push the ASCII code for every character in the Lorem Ipsum string, concatenate everything, and output.

\$\endgroup\$
2
\$\begingroup\$

MATL, 354 characters

'8 sxAI($ltZ>2<xa`vYf:s2e9]c&^KtD%e{C*XEpQ]]>dwmi>2;{sUCIZ{V(}Yj 7K&)|,%JD/Pz^:3$*@vVJw)4pgvz4s_$,%pVGu~|PS/Qr7pz5Z2[VV{Lyq}{l!yGiKNg.zFJxL75 sT1]eL2f3iVe~11!|6c+O9.kMWFQYvEp^w0p oH,?Ey"nbV>0g`#)kqTq""" z_AYmyJutvg:o9&AT{#(<42wu.b7" QoOn\#])]ISdH$yc{eM> .[~/`"#2:7C4Mk@eRW8L*_!xjo\cO)!LHK=g:P?&Uc];KdnE(%K7J-z9:7&rhxHl/KZ8\t_C|rT#%28[%+#u.?'F2Y2' ,.DEL'hZa

This decodes from base-94 (using the printable ASCII chars except single quote; so only Unicode characters up to 126 are used) to the alphabet of required characters, formed by most lowercase letters, some uppercase letters, space, comma, and period.

It takes a few seconds in the online compiler.

Try it online!

\$\endgroup\$
2
\$\begingroup\$

JavaScript (ES5), 342 characters

c="remo ipsudlta,cngbq.UvxDhfE";"L"+"Qq©Úu[Qsx7Ķz`¾ƅ&Øxø§Ëƴ%ţ¾÷öm¿Zw¥ſøûƠtĭĚǎmĭöđnŔơxēǮŗĭ*x÷;ƚ:ȸƚņţǮ{XĩámɓŏƙâĚDUĚǎÁƚÂtĭŎݦ1mňŽ8ZUŽƜ-äļÝÁŌĪqu[Qqƙ¢3*ôĭ[ÞĵĪ%mÄſĘÚu[Q#èĭƝĘň®ŏØȅ˔Ż­#ÂƠoƈŅƆĭƂ§ÿĵĭƘƙ¢VôƠţÅƠqƙƂĔňǮjʨſňô¾Ơn[ēĭœq÷\"ĭĚǎI".split('').map(function(x){y=x.charCodeAt(0);return c[~~(y/27)]+c[y%27]}).join('')

Pretty straightforward, so I'm sure there's room for improvement. I encoded every pair of output characters as a single Unicode character.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Do you need the var ? \$\endgroup\$ Sep 8, 2016 at 18:03
  • \$\begingroup\$ Great point, I've shaved off those extra characters. Thanks! \$\endgroup\$
    – Eric Dobbs
    Sep 8, 2016 at 18:04
  • \$\begingroup\$ If you use ES6, replace join('') by join``. If not, change your language to JavaScript (ES5) \$\endgroup\$ Sep 8, 2016 at 18:37
  • \$\begingroup\$ I think you can do y/27|0 rather than ~~(y/27) to save two bytes. You can also remove the 0 in x.charCodeAt(0). \$\endgroup\$ Jan 17, 2017 at 18:04
  • \$\begingroup\$ Also, .split('').map(function).join('') can be .replace(/./g,function) \$\endgroup\$ Jan 17, 2017 at 18:06
1
\$\begingroup\$

Vyxal, 279 bytes

«;Jq×L↑yVx₅QȯZ3ẎhȦ¼_ø€ẋ°Q±3₀₈∑hṁ₃ø∧≤∆⌐>ʀ↵₌X⇧ƒ₀₆ḃ₅Ḣ~^9\6↓¾<₆≈Q‡‟ṄBḞUß¼ƈv→⟇ʀ7ė⟑∞~*Ṅ∩ꜝtW₴h⟨p&¥z%₇Jɖ⁋¥(₂⌐⌊mṖ⅛ɾṙ3±żð→Ṙq↳'ḭguIH?TLŻrhNɾwl꘍×ByÞkĿMτI□ǑΠȧ½Ḃ≬jȦ₂ṡ⇧j…0Ȧ₂wyẆ₈≠₂d„⟨>∵↔C7⟇≠∑¤ƈƛiḃṁ₍Q]*꘍ṡḂcu%İ∑lL5∧∴!qÞLOτxÞ≥€ṅQh₅Ṫ°₄B*ṫṘ:NḊεβ⋏ṫẎFpƈc⁰ŀqẏy↓{'Ǒ£ẏŻ@kżoƛg)K1cV⌈»ΠC¼⟩F^ȯ₌«\z‛. V‛  ‛, V¡

Try it Online! Uses Vyxal base-255 encoding, since it can only do lowercase and space, I convert ". " to z and "," to " ", so when I decompress I can easily add back in the punctuation. Finally, it reintroduces uppercase through the sentence-case operator.

\$\endgroup\$
1
\$\begingroup\$

Pip, 139 UTF-8 characters

"EDUL ,.".z@:^A*"𝜋򙇶󎹤񕙕󁌯󑃳񞢤񍚙񚝋󖼄𺧶񾔯򣒋򓽅𦕪𢪤񛽹򝕄󒹶򮂏򢗪񺭴󑍺𤣨򮅤񞢊򬪸񙉧񭃤𼧷󙳄𖢋򣹤𺢓񽇳𧅴񹹥𥽯󉊕󎬛񑅾񞄯󑽏򭂛򔣳񍒒𺊸񾒔񾗤󞢇򓻻񽢋󱅧𢚳򝕕𢚴󊻻𾣄𡽺񙇸󞅤񕙕󁇴𦅶󂷋򢥸񾢏򡎕򖻚𾥤󢹏󑅹󊲉񼩛򙅕򕜋𢽤񦶯𾢔󜩇𥣸񹽛󁢀󲕶󒽸𦗴󑊩񉵩𾢉󝧪𾣺𥊴𥬕񺥴󑒙󝍄񽂉󜫇𥽯𥖌񺗧𢥹񞍴󑉵򔧺𡺏򙇪𢼺𤣨򮍳"TB32FB:32

Try it online!

Explanation

Observe that there are 28 distinct characters in the string. We can use characters up to character code U+10FFFF = \$1,114,111\$, and since \$\sqrt[4]{1,114,111} \approx 32 > 28\$, we can pack four Lorem Ipsum characters into one Unicode character. (In theory, we might run into some forbidden characters within that range. In practice, that didn't happen.)

The decoder is a little longer than it should be because Pip's builtin base conversion generates strings (e.g. "1RFP") rather than lists of numbers (e.g. [1;27;15;25]).

"EDUL ,.".z@:^A*"𝜋..."TB32FB:32
                "𝜋..."           String of 112 Unicode characters
              A*                 Codepoint of each
                      TB32       Convert each to a (4-digit) base 32 number
             ^                   Split each base 32 number into a list of its digits
                          FB:32  Convert each digit from base 32 to an integer
           @:                    Use those numbers to index into
"EDUL ,.".z                      Character lookup table: "EDUL ,." plus lowercase letters
\$\endgroup\$
1
\$\begingroup\$

05AB1E, 126 characters

A large integer is encoded in base 1114111, which is converted to custom base " .,a..z" and the resulting string is converted to sentence case.

"􏿿૵򡏚򈣸󑰙𴿧𦛭񆛤𝌱񊷈􊢗􋄇򟰕򋴜𓏃󠝲򸵫򒕎𯑇񜥷𷇞󛷪􆥮񹳞򵪦󾔁𵇫񽅨功򜡸񄟎𗼵󾌢񂰹󌲏񱲼񺪓񑷯򈽧𘟅󬕲񦗷剗񁛍󛋢􎔊󼱃儮򹔊򤬲򈏉􏢮𝔐󪸉󘝙񍺻􀺿􏶺򑑩򤺶򈳚󸙆񆸏􃜘񁹂򚽊󊫸򺙵򔗲𖁙񕅱𨸞򢟊򏷔󐥓򈞰򺽆񲋧񯺼򭋕񺦶􈫭󤜘𵓈𽂿𷟮򢒽󾫺𢠑򓁌򾟍𞍿􍵻󮘻򸷒񳗩񫄪󈆁񐶢򺍮􀕛񑖑󆷰𣽖񚮾󌞴򃋏󽷤"ÇćβA… .,ìÅвJ‡.ª

Try it online!

Or, with byte scoring:

05AB1E, 277 bytes

.•Jã‘éLõÝåʒ?ÿU
¤Ú¹αšt\Žαæ™4c\’ÑÑ[Ï!îèιáܶ§:ºÃbxxQΩù2ú²º„¶₄êy³Ôá‚ιüá‚ÖÆjηatÜÿ˜≠²Ÿ‹»BˆAÇλ—W?üÿ¾TP׸˷]Δ…È¶ª¢X9ât稒ƶövY∞ʒE¯Š¿[¹|εÔgƵΣCõ÷yʒĆ7hZ`ĀÀAFнúO¡]îγĬ-Ðu†₂≠т,ÜÞör,™¨}м!s±ÑH—‘DθwO³¦&‚ÚøγF∊6∊7p×Ì"₄ôʒÛ₅,ÿɽOϦÃ9-p¦»:nÒƶÙØ¶∊[₁?θsÑK„³½ζp÷‰oæB¤|λ·(θŒ¨”∍∊₄=Ýá¾ÉĆΓΓŒ*›αβ™•„wy„.,‡.ª

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Jelly, 300 chars

“ḊḄr⁷ƤⱮx#y&Ọ¬½ẇṾƤẋRṠỊ/IṗIÞƝỊż,CA~ñ;ßɦ4ṿḷNVẸẆ`°ṄjJ⁽Ɱ!Æḋ"uƒ⁽ƙfƈÇœƓ®ḶẓƭƊȮ⁻w}Ġṙ(1€CÐ-ɼ#ȯjėȮoZœ°ȥạ_ẊƊaʠiẸṂṪẒ$ċⱮiẹOṠBṇḲ^*GƓŒA>żıWṭƤe&ėẠF6³ṂḲzlçÇṪġṂŻỵḢ⁴WJC⁽Ỵihıỵṃ¥ẏƬEỴ⁽#ḍʠḢ*^O[4)ỵZ5VoPĠƘṙḅß]<œ/ṅẸ% ḍ"Ɱ+¢¦ß÷⁵Ḍ³Ṅ¶2X|©dċÆṁḢƭṗM°`KǦɗỤɱṆȯƘkṅbṙ⁻l<t,ḟȮạżæ€ṠṣIȥCṘƥṁ©53ẒþØŻṁ£æƥ?¬ṿFæṘ⁴nụ’ṃ“Lrem ipsudlta,cngbq.UvxDhfEo

Try it online!

The encoding is Jelly.

Thanks to compressed strings, I was able to compress it by 3 bytes.

\$\endgroup\$
0
\$\begingroup\$

Deadfish~, 3209 bytes

{{i}ddd}iiiiiic{iii}iiiiiciiic{d}dddc{i}ddc{{d}ii}iiic{{i}ddd}iiic{i}dddciiiciic{d}iic{{d}ii}iiic{{i}ddd}ddc{i}icdddciiiciiic{{d}ii}ddc{{i}dd}iiic{d}c{i}ic{{d}ii}ddddc{iiiiii}iiiiic{i}iic{d}iic{i}iiiiic{{d}iii}ddc{d}ddc{{i}ddd}dddc{i}iicdciiiiic{d}ddddcddc{ii}dddc{d}dddddc{i}iiiiicicdddc{{d}ii}ddc{iiiiii}iiiiiciiiciiiiic{i}dddc{d}iiic{i}c{d}ddddddciiiiiiciiiiic{d}iiic{{d}iii}dc{{i}ddd}dc{i}dddcdddc{i}ic{{d}iii}ddc{d}ddc{{i}dd}iiic{d}ddddcdc{{d}iii}iic{{i}ddd}ddc{i}ic{{d}ii}ic{{i}ddd}dciiiic{i}iicddcddddddciic{d}dc{{d}iii}iic{{i}dd}iiiic{d}dddddc{i}ddciiicdciiic{{d}ii}ddc{{i}ddd}iiiciiiiic{d}dciiiiiicdddddciiiiicdddddc{ii}dddc{d}iiiciiiiiic{{d}ii}ddddc{{i}dd}iiiiicdc{{d}ii}ddddc{{i}ddd}iiiiiic{d}dcic{i}iiiciiic{d}dddc{{d}iii}ic{{i}ddd}dc{i}iiiiic{{d}ii}ddddc{{i}ddd}ddc{i}icdddciiiciiic{d}dddc{{d}iii}ic{{i}dd}dddc{d}ddciiiiiic{i}dddc{d}dddc{dddddd}dddddc{iiiiii}iiiiic{i}icdddc{i}ddciiiic{dd}c{ddddd}dc{d}ddddc{iiiii}iiic{iii}ic{{d}ii}ddddc{{i}ddd}dc{i}dcdddddciiiic{{d}ii}iiic{iiiiii}iiiiiciiic{{d}iii}iic{{i}dd}dddcddddciiiiicdddddciiiic{{d}ii}iiic{{i}dd}iiiiiic{dd}iiic{i}dcdddddc{d}iic{i}iic{dddddd}dddddc{d}ddc{{i}dd}iciiiic{d}ddc{i}c{{d}ii}dddc{{i}dd}ddciciiiicicddciiic{dd}iiic{{d}iii}iic{{i}ddd}dc{ii}dc{dd}ic{i}iiic{d}dddddciiiiiic{i}ic{dd}ic{ii}dc{d}dciiiiiicdc{{d}ii}iic{{i}dd}iiiiic{d}icc{d}dc{i}iic{d}c{i}iic{{d}ii}ic{{i}ddd}iiiiiic{d}dcic{i}iiiciiic{d}ic{i}c{{d}ii}dddc{{i}dd}ddcdddddc{i}c{d}c{{d}iii}dddc{{i}dd}iiiiicdc{{d}ii}ddddc{iiiiii}iiiiic{i}icdddc{i}ddciiiic{d}ddc{i}dddc{{d}ii}c{{i}ddd}dc{ii}dc{{d}i}iic{{i}ddd}dcddddc{dddddd}dddddc{{i}ddd}dddc{i}iicddcciic{d}dc{i}ic{{d}ii}ic{{i}ddd}dddc{i}iicdciiiiic{d}ddddc{i}iiciiiic{dd}c{ii}dc{{d}iii}c{d}ddddc{iii}iiiiiic{iiiii}dc{d}ddc{i}c{{d}ii}dddc{iiiiii}iiiiic{ii}cdc{d}dddddc{{d}iii}ic{{i}ddd}iiic{i}dciiicdddc{d}dddc{{d}iii}ic{{i}ddd}ddc{i}icdddciiiciiic{{d}ii}ddc{{i}ddd}iiiciiiiic{{d}ii}iic{{i}dd}iic{d}dddc{i}iciic{d}dddciiicdddc{i}dc{d}cic{i}iiic{d}ic{i}ic{{d}ii}ddddc{{i}ddd}iiiciiiiic{{d}ii}iic{{i}dd}iiiiiic{d}iiicdddc{i}dcdddddciiiic{dd}ic{ii}dc{d}dddddc{{d}iii}ic{{i}dd}iiiiiic{dd}iiic{i}dddcdddc{i}ic{{d}ii}ddddc{{i}ddd}dc{i}iiiicc{d}ddddc{{d}iii}ic{{i}ddd}dddciiiiiiciiicc{i}dc{d}iic{{d}ii}iiic{{i}ddd}ddc{i}icdddciiiciiic{d}dddc{{d}iii}ic{{i}ddd}dc{i}iiiiiic{{d}ii}dddddc{{i}ddd}c{i}iiiiic{d}ddddciic{d}iic{ii}dc{{d}ii}ddddc{{i}dd}ddc{i}dddc{d}icc{d}dc{dddddd}dddddc{{i}dd}c{d}dddddc{ii}dddc{d}ic{d}iic{ii}dcicdddc{{d}iii}iic{d}ddddc{iiii}dddc{iiiii}ic{dd}dciic{i}iciiiic{d}dddddc{i}iiiiiicdddc{{d}ii}ddc{{i}dd}iiic{d}ciiiiiciiiiiic{{d}ii}ddddc{{i}dd}dc{d}ddccddciiiicddcddc{ii}dc{{d}ii}ddddc{{i}ddd}dddc{ii}ddcdddddc{d}iiicdddddcdddc{ii}dc{dd}ic{ii}dc{{d}ii}ddddc{{i}dd}ddcicdc{{d}ii}iic{{i}dd}ciicdddcddddddcdddddcic{i}dciiiiiic{{d}iii}ddc{d}ddc{{i}dd}iiiciic{d}iiiciiiiiic{{d}ii}ddddc{{i}ddd}iiiciiiiic{{d}ii}iic{{i}ddd}dddc{ii}ddc{d}iciiiic{d}dddddc{dddddd}dddddc{{i}dd}iciiiic{d}ddc{{d}iii}dddc{{i}dd}dc{d}icciiicddddddciiiiiic{d}iic{dddddd}dddddc{{i}ddd}ddcic{i}iiiic{d}ddddc{i}iiiciiic{d}iiiciiiiiic{{d}ii}ddddc{{i}dd}dddciicdddccdddc{i}ic{{d}ii}ddddc{iiiiii}iiiiic{i}iiicdddddciiiic{{d}ii}iiic{{i}ddd}iiicdddddc{{d}iii}iic{{i}ddd}dc{i}iiiicic{{d}ii}ddddc{{i}ddd}iiiiiic{d}dcic{i}iiiciiiciiic{d}iic{dddddd}dddc

Try it online!

Who cares about all that compression nonsense...

\$\endgroup\$
0
\$\begingroup\$

Deadfish~, 3061 characters

{i}dsdddddc{{iii}d}iciiic{d}dddc{i}ddc{{ii}dd}dc{{i}ddd}iiic{i}dddciiiciic{d}iic{{ii}dd}dc{dd}ddsc{i}icdddciiiciiic{{d}ii}ddc{{i}dd}iiic{d}c{i}ic{{ii}ddd}iic{{iii}ii}ic{i}iic{d}iic{i}iiiiic{{d}iii}ddc{d}ddc{dd}ddsdc{i}iicdciiiiic{d}ddddcddc{ii}dddc{d}dddddc{i}iiiiicicdddc{{d}ii}ddc{{iii}ii}iciiiciiiiic{i}dddc{d}iiic{i}c{dd}iiiiciiiiiiciiiiic{d}iiic{{d}iii}dc{dd}ddsic{i}dddcdddc{i}ic{{d}iii}ddc{d}ddc{{i}dd}iiic{d}ddddcdc{{ii}d}ddc{dd}ddsc{i}ic{{d}ii}ic{dd}ddsiciiiic{i}iicddcddddddciic{d}dc{{ii}d}ddc{{i}dd}iiiic{d}dddddc{i}ddciiicdciiic{{d}ii}ddc{{i}ddd}iiiciiiiic{d}dciiiiiicdddddciiiiicdddddc{ii}dddc{d}iiiciiiiiic{{ii}ddd}iic{dd}dsddddcdc{{ii}ddd}iic{{i}dd}ddddc{d}dcic{i}iiiciiic{d}dddc{{d}iii}ic{dd}ddsic{i}iiiiic{{ii}ddd}iic{dd}ddsc{i}icdddciiiciiic{d}dddc{{d}iii}ic{{i}dd}dddc{d}ddciiiiiic{i}dddc{d}dddc{{ii}d}ic{{iii}ii}ic{i}icdddc{i}ddciiiic{dd}c{ddddd}dc{d}ddddc{{iii}i}dc{iii}ic{{ii}ddd}iic{dd}ddsic{i}dcdddddciiiic{{ii}dd}dc{{iii}ii}iciiic{{ii}d}ddc{{i}dd}dddcddddciiiiicdddddciiiic{{ii}dd}dc{dd}dsdddc{dd}iiic{i}dcdddddc{d}iic{i}iic{{ii}d}ic{d}ddc{{i}dd}iciiiic{d}ddc{i}c{{d}ii}dddc{{i}dd}ddciciiiicicddciiic{dd}iiic{{ii}d}ddc{dd}ddsic{ii}dc{dd}ic{i}iiic{d}dddddciiiiiic{i}ic{dd}ic{ii}dc{d}dciiiiiicdc{{d}ii}iic{dd}dsddddc{d}icc{d}dc{i}iic{d}c{i}iic{{d}ii}ic{{i}dd}ddddc{d}dcic{i}iiiciiic{d}ic{i}c{{d}ii}dddc{{i}dd}ddcdddddc{i}c{d}c{{ii}dd}iiic{dd}dsddddcdc{{ii}ddd}iic{{iii}ii}ic{i}icdddc{i}ddciiiic{d}ddc{i}dddc{{d}ii}c{dd}ddsic{ii}dc{{d}i}iic{dd}ddsicddddc{{ii}d}ic{dd}ddsdc{i}iicddcciic{d}dc{i}ic{{d}ii}ic{dd}ddsdc{i}iicdciiiiic{d}ddddc{i}iiciiiic{dd}c{ii}dc{{d}iii}c{d}ddddc{{iii}d}iic{iiiii}dc{d}ddc{i}c{{d}ii}dddc{{iii}ii}ic{ii}cdc{d}dddddc{{d}iii}ic{{i}ddd}iiic{i}dciiicdddc{d}dddc{{d}iii}ic{dd}ddsc{i}icdddciiiciiic{{d}ii}ddc{{i}ddd}iiiciiiiic{{d}ii}iic{{i}dd}iic{d}dddc{i}iciic{d}dddciiicdddc{i}dc{d}cic{i}iiic{d}ic{i}ic{{ii}ddd}iic{{i}ddd}iiiciiiiic{{d}ii}iic{dd}dsdddc{d}iiicdddc{i}dcdddddciiiic{dd}ic{ii}dc{d}dddddc{{d}iii}ic{dd}dsdddc{dd}iiic{i}dddcdddc{i}ic{{ii}ddd}iic{dd}ddsic{i}iiiicc{d}ddddc{{d}iii}ic{dd}ddsdciiiiiiciiicc{i}dc{d}iic{{ii}dd}dc{dd}ddsc{i}icdddciiiciiic{d}dddc{{d}iii}ic{dd}ddsic{ii}ddddc{{ii}ddd}ddc{{i}ddd}c{i}iiiiic{d}ddddciic{d}iic{ii}dc{{ii}ddd}iic{{i}dd}ddc{i}dddc{d}icc{d}dc{{ii}d}ic{{i}dd}c{d}dddddc{ii}dddc{d}ic{d}iic{ii}dcicdddc{{ii}d}ddc{d}ddddc{iiii}dddc{iiiii}ic{dd}dciic{i}iciiiic{d}dddddc{ii}ddddcdddc{{d}ii}ddc{{i}dd}iiic{d}ciiiiiciiiiiic{{ii}ddd}iic{{i}dd}dc{d}ddccddciiiicddcddc{ii}dc{{ii}ddd}iic{dd}ddsdc{ii}ddcdddddc{d}iiicdddddcdddc{ii}dc{dd}ic{ii}dc{{ii}ddd}iic{{i}dd}ddcicdc{{d}ii}iic{{i}dd}ciicdddcddddddcdddddcic{i}dciiiiiic{{d}iii}ddc{d}ddc{{i}dd}iiiciic{d}iiiciiiiiic{{ii}ddd}iic{{i}ddd}iiiciiiiic{{d}ii}iic{dd}ddsdc{ii}ddc{d}iciiiic{d}dddddc{{ii}d}ic{{i}dd}iciiiic{d}ddc{{ii}dd}iiic{{i}dd}dc{d}icciiicddddddciiiiiic{d}iic{{ii}d}ic{dd}ddscic{i}iiiic{d}ddddc{i}iiiciiic{d}iiiciiiiiic{{ii}ddd}iic{{i}dd}dddciicdddccdddc{i}ic{{ii}ddd}iic{{iii}ii}ic{i}iiicdddddciiiic{{ii}dd}dc{{i}ddd}iiicdddddc{{ii}d}ddc{dd}ddsic{i}iiiicic{{ii}ddd}iic{{i}dd}ddddc{d}dcic{i}iiiciiiciiic{d}iic{{ii}d}iiic

The code is too long for the recursive Python implementation on tio.run. So here is another link which works (I took it from this other answer).

Try it online

Not sure it's optimal, but should be pretty close. It uses the s command. It also takes advantage of the overflow feature when it's useful - when the accumulator is equal to 256, it wraps around to 0.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.