16
\$\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\$
  • 2
    \$\begingroup\$ Sadly =lorem() in MS Word doesn't output the right version \$\endgroup\$ – BlackCap Sep 8 '16 at 16:18
  • 4
    \$\begingroup\$ 3 answers so far specifying bytes. Methinks some people may not have read the challenge \$\endgroup\$ – Robert Fraser Sep 8 '16 at 16:57
  • \$\begingroup\$ @RobertFraser: In my case it makes no difference as 1 byte = 1 char, so I might as well specify bytes as that's the standard. If I had earned any by using chars I would have specified thus :) Pretty sure the same is true for the other answers. \$\endgroup\$ – Emigna Sep 8 '16 at 16:59
  • 1
    \$\begingroup\$ Is it permitted to make an http request? \$\endgroup\$ – Master_ex Sep 8 '16 at 18:05
  • 2
    \$\begingroup\$ This feels like a dupe of the this challenge as there aren't any patterns in the text? \$\endgroup\$ – FryAmTheEggman Sep 8 '16 at 19:05

11 Answers 11

6
\$\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\$
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\$
  • \$\begingroup\$ If you use ES7, you could use 4**8 instead of 65536. \$\endgroup\$ – mbomb007 Jan 17 '17 at 17:50
  • \$\begingroup\$ @mbomb007 Thanks. Perhaps that will come in handy in other challenges too \$\endgroup\$ – ETHproductions Jan 17 '17 at 18:09
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\$
  • \$\begingroup\$ Welcome to PPCG! Nice first post! However, we count things in bytes here. Sorry. \$\endgroup\$ – Rɪᴋᴇʀ Sep 9 '16 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 '16 at 22:23
  • 1
    \$\begingroup\$ I'm... an idiot. Sorry about that. >_> \$\endgroup\$ – Rɪᴋᴇʀ Sep 9 '16 at 22:24
  • 2
    \$\begingroup\$ No problem, I bet the bytes–characters thing is a common mistake on other questions. \$\endgroup\$ – user59468 Sep 9 '16 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\$
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\$
  • \$\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 '16 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 '16 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\$
  • 1
    \$\begingroup\$ Do you need the var ? \$\endgroup\$ – Paul Schmitz Sep 8 '16 at 18:03
  • \$\begingroup\$ Great point, I've shaved off those extra characters. Thanks! \$\endgroup\$ – Eric Dobbs Sep 8 '16 at 18:04
  • \$\begingroup\$ If you use ES6, replace join('') by join``. If not, change your language to JavaScript (ES5) \$\endgroup\$ – Paul Schmitz Sep 8 '16 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\$ – ETHproductions Jan 17 '17 at 18:04
  • \$\begingroup\$ Also, .split('').map(function).join('') can be .replace(/./g,function) \$\endgroup\$ – ETHproductions Jan 17 '17 at 18:06
1
\$\begingroup\$

Jelly, 300 chars (non-competing?)

“ḊḄ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\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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