title: Print This Question ↓

text:
# Question
Title: Print This Question ↓
The basic idea of a challenge is to print a set output in the shortest code (though that meaning has changed now). We have had many of them, from Borromean Rings to The Gettysburg Address.

##Your Task

This question is similar, except that it requires printing of a special text - the text of this question. Specifically, the very Markdown code that I am typing right now.

To prevent an infinite recursion in the question, the exact text you have to print can be found here.

##Clarifications

* You are not allowed to use any external sources like the internet.
* This means that the purpose of this question is not to download this question text and parse it, but instead to store it in you program.
* This is , so shortest code in **bytes** wins!

# Answer
> 31 votes
# Bash, ~~608~~ 597 bytes

```
0000000: 74 61 69 6c 20 2d 6e 36 20 24 30 7c 7a 63 61 74 0a  tail -n6 $0|zcat.
0000011: 1f 8b 08 00 00 00 00 00 00 00 95 93 d5 b6 e3 3c 0c  ...............<.
0000022: 46 ef fb 14 fa 71 a8 2e f7 d0 d5 30 33 f3 8c 9a 28  F....q.....03...(
0000033: 89 57 13 2b c7 56 0a 6f 3f 56 3d cc 53 6e ec 6c 69  .W.+.V.o?V=.Sn.li
0000044: ed 4f 7e 58 11 2c 30 d8 0c 6c 4e 08 5c 00 c2 0b c1  .O~X.,0..lN.\....
0000055: f2 68 c9 75 c3 25 7b 5e 99 8c 9b b6 a6 8d 95 ed 2b  .h.u.%{^........+
0000066: c8 2a ac 6b 72 25 81 0d 20 0c ad b7 4e 00 21 90 00  .*.kr%.. ...N.!..
0000077: 77 d2 76 02 d6 81 44 6a a8 d8 0b 05 81 8c 73 82 93  w.v...Dj......s..
0000088: 52 71 57 56 71 05 05 1a 42 67 5d 09 15 06 05 46 5a  RqWVq...Bg]....FZ
0000099: 0e 8e d7 a7 06 f0 84 a0 c2 95 7e e4 d0 a0 db 02 17  ..........~......
00000aa: 0a 6b fa 50 78 6e e0 c5 79 f6 9e f5 76 b8 1f 01 e1  .k.Pxn..y...v....
00000bb: d5 c9 4a a4 3d 1a 0e b5 46 c9 75 31 08 82 d9 92 36  ..J.=...F.u1....6
00000cc: 89 3a 88 9d 0f 8f 3b 0a 62 d9 85 e1 7c 3a 1b ef 0f  .:....;.b...|:...
00000dd: 31 64 d6 9a c5 07 90 f1 0a 3a 05 c2 f0 42 65 5c 21  1d.......:...Be\!
00000ee: 91 6d 58 74 be 84 73 79 ee 29 fc 61 91 f1 7c 7a 38  .mXt..sy.).a..|z8
00000ff: 1f 56 bc 36 1e 5d ce 8d b1 c1 48 45 a6 fc c8 35 98  .V.6.]....HE...5.
0000110: b8 a7 06 bd de 3f ff 3c e3 ce c3 43 0c cb 5e ef 61  .....?.<...C..^.a
0000121: 15 9d 7e 20 a9 df 60 1b 5b a3 ef 43 ac 45 ad 24 79  ..~ ..`.[..C.E.$y
0000132: 56 c0 d3 71 67 23 22 d9 8f fd a7 dc 42 4b 99 c5 1a  V..qg#".....BK...
0000143: 84 36 02 46 bd a5 9f ea f0 73 f4 00 1e e8 ce c2 66  .6.F.....s......f
0000154: 31 cb 6d 7f b7 71 45 7e 0b b7 d0 2f 73 5e bb 14 d9  1.m..qE~.../s^...
0000165: ae da 35 c0 06 64 db 6a 11 6f cb 4a 34 a8 41 ec 55  ..5..d.j.o.J4.A.U
0000176: a3 a7 15 69 f8 0e ac 2b ac b3 42 e0 29 eb 7c d0 f6  ...i...+..B.).|..
0000187: d3 14 7c ac 99 aa d0 06 33 49 4d 6d b9 4b 51 7f 1c  ..|.....3IMm.KQ..
0000198: a2 2c 82 16 04 05 77 2e 87 17 15 79 fa 1d f3 b1 09  .,....w....y.....
00001a9: 1b 92 f9 62 7f 3a 26 9c 9a d1 e1 7c 64 66 8b d1 d4  ...b.:&....|df...
00001ba: 20 1d ce cd 64 56 e0 c1 78 82 87 38 39 18 ae 2c ad   ...dV..x..89..,.
00001cb: 4d 88 ce 33 4a fe 2f 44 c1 3b 15 a2 90 5e cf 40 4c  M..3J./D.;...^.@L
00001dc: 04 d0 13 38 16 88 82 78 4d b9 36 d9 05 02 9d c8 d8  ...8...xM.6......
00001ed: 3c 79 17 35 27 4a 80 da 2e 55 16 81 75 ba 42 32 88  <y.5'J...U..u.B2.
00001fe: 10 cd 72 37 e7 21 79 d4 f5 b6 f3 2d 07 fa 26 0f b0  ..r7.!y....-..&..
000020f: 41 8b 69 11 b5 5f 33 e6 5f 6e 48 c6 30 6a 69 d1 47  A.i.._3._nH.0ji.G
0000220: 80 95 3e 2c 76 27 2d 08 e9 66 86 20 ec 75 41 bd ab  ..>,v'-..f. .uA..
0000231: da d6 73 e9 b1 f9 d8 8a 0d e9 58 ab 49 a3 2a 5f f5  ..s.......X.I.*_.
0000242: 21 f0 97 87 54 ef 3d 7d 7a b1 15 0a a7 4f c3 3a d2  !...T.=}z....O.:.
0000253: ff 7a                                               .z

```

The above is a reversible hexdump. To create the file, execute

```
xxd -r -c 17 > 55857.sh

```

paste the hexdump and press `Enter`, then `Ctrl` \+ `D`.

To run created file, execute

```
bash 55857.sh 2>&-

```

Any other filename that contains no whitespace, doesn't start with a dash or contains shell expansion characters (e.g. `*`) will do.

I chose zopfli as the compressor since it is compatible with the Coreutils program zcat and achieves better compression than gzip, bzip2 and xz.

`tail -n6 $0|zcat` reads the last six lines of the source file and pipes them to zcat. The following lines are full of syntax errors and produce no output.

Note that zcat will print a warning (since I stripped the checksum of the compressed file), as will bash (because of the syntax errors). These warnings are printed to STDERR (suppressed by `2>&-`), which is allowed by default per consensus on Meta.

# Answer
> 13 votes
# Javascript (ES6), ~~977~~ ~~964~~ 902 bytes

Used the find-and-replace method to save 95 bytes overall, then converted the entire program to Base64, which saved another 62. (Converting the entire thing took me *two whole hours!*)

```
eval(btoa`k23\r8^ù¶¬Ï¢uæ¾¡ÿVJ%(®óÝÊ&¦W±Ü³ãç!jY^¾Ãù¯¬zß¨ºÚn·è§6Èh®×¬·ç(uï³æØhº~¶úg)àú¬ùÈZúz0Ï¬ûùg¾«Þúúf§ËêúØ^?>~º&û=A/äb'þwã^ÿjÇ"=Û/=ëx,Ï£³Õ8^øb¾×kzË'ýyßÞ3Þ¶§v³Þ+3ÞØ^Ïx
Ïvv·¬³>³íÀÌ(º¿jÉLO¢³ë")Z¯?>{¦ß«~ß«z«¢ë>>)àúþkë)yÈ\\÷úØ^þ´Lûù*^r'âq©eË?\r½êòøÆ«Ú0ç(uï«~#æ¦úÜ©x>®(!·éèÃ>ÐN©ëÞßè§~)âµï«yË«²*'ú)Í'?\r{´\\¨»èZ½ãùÆ§ù·¾~§wìõêÞ·¯È¨Ïõ½õyóßOyÓ=øoMóÝ§½ç=öáö¼×f½ko?¾'°Ï{(º·Ï¬ûC03\0)Z®'âq«b¢{Ï¢ïï§¢ßZ0yÓ®±ï/Æ×«©~²«që>)6)íz¹Þ´yj{>¶6«¦úþ´O¢³éè´çhÂyhißV§wêZ®Ç¾Üüù»ú)ìµæ:Ëhï¢·è§û*.úè¶¦+r^Ïx(üøÏÏ¬£ë!¢»^²ß¡×¾³0[Ê×¬ÌÁû§³0³?3×>óï>ÜÌÉ@14ãÕÌøÏ¹§>qÌÊk2ÏºÞ¦V{>^½©sç0ÿÌ\\ÆÇ1ÿ0óë?3?sõøÏm¶öÿ÷(uè(üû²Öì\\©à{>Ü¢oÙ+>%{~g>ó÷=þN¬ù®zËb¢v^¶Ü¬nêàfë¢gïúÚ>fâÖ~Ï[Z=³>ì¦XÌ6s=\\Ï¸§uìN>qÏ¬øÏ¬úÏÆ¥z»så¬ú`.replace(/z(.)/g,y=>' [:-]().,\r#*!`\\${}=\'>'[parseInt(y[1],36)]).replace(/\+/g,' '))

```

There are a *ton* of unprintable characters in this, so here's the raw data: http://pastebin.com/FR6Ah0ZL

And the original encoded text:

```
a=`The basic idea of aVkolmogorov-complexity] challenge isOP a set output inNshortest code (though that meaning has changed now). We have had many of them, from [BL Rings](DJ/53417/ascii-bL-rings)O[The GK Address](DJ/15395/how-random-is-the-gK-address).Q##Your TaskQTE is similar, except that it requires Ping of a specialF- theFof tE. Specifically,Nvery Markdown code that I am typing right now.QTo prevent an infinite recursion inNJ,NexactFyou haveOP can be found [here](Drevisions/1f731ea3-0950-4b03-ae95-24fa812a9a28/view-source).Q##ClarificationsQ- You are not allowedOuse any external sources likeNinternetHmeans thatNpurpose of tE is notOdownload tEFand parse it, but insteadOstore it in you programHisVcode-golf], so shortest code in **bytes** wins!`,[...c='QDEFHJKLNOPV'].map(x=>a=a.replace(eval(`/${x}/g`),`

Zhttp://codegolf.stackexchange.com/Zhis JZ text Z.
- This ZquestionZettysburgZorromeanZ the Z to ZprintZ [tag:`.split`Z`[c.indexOf(x)])),alert(a)

```

More explanation coming soon!

**EDIT 1:** Shaved off 13 bytes.

**EDIT 2:** Converted to Base64.

# Answer
> 6 votes
# Linux Shell 843 bytes

```
#!/bin/sh
base64 -d <<M|zcat
H4sIAKBL5lUAA5WTQW/bMAyF7/kVHHppgyhOmgRtett2GHbYZQswDEEPtE3bQmzRlegk/vejZLTY
etoAIw4s6fHxe9ShIcgx2AJsSQhcAcJRsH46cdtxzZ7PpuCub+lqZXyGosG2JVcT2ADC0HvrRM8E
EuBB+kHAOhBVDQ17oSBQcElwKw0PdaMrKNAROutqaDBEQVUrwfHlbgk/ST+e408JHboxGlKxbgGV
5w6On9jrW4/DdxUIz7eNSP+UZbFGzW21DILFia6T6lKdZy+DmrDsQrbbbNcPGYbCWpO/Chkfhe5i
L8eD2v5CImPIB1/Dx7L0FP6zyHq32e+yhi/Goyu5MzYY7cDUb7oGJ9275Wx2c/OLBw8HDKfZ7NAo
01elyDfYzrboF6C1qJcJnhXw9DJYlZjoR5Ipt9BTYbEFoauASSGkv4nhH9JL+BF3VrbQLMdF2ngm
P8I39KeSL26KLFX7CtiBjH0s4m3dSAxKjR9i9HSmGL56dZV1VkidFYMPyf40Ba81pyp0xUImUyMP
U9RvQ1SoUE5Q8eBKODbk6V/IqwkbJvLVw2ZNuDGr/W5ltvlqY5D2O3O/rfBxfY97vH/MzpYuJijz
gib+nxVwQpHim80MaCKAnrRR7a1t+aLTqSaHQBAnUs2Td4p5UgnQ2hOl7rQJXSFZqkjKMs5XmDjG
9X7wPavK+zxi1LGYFon0W9bh/3tDIqbjBD16FbCygDzdtCCEyV0Q9nEhco9oe8+1x+7Nij7pWkeS
JqJ8XmgD7y6pnp3P81E/zOdwUfUPvwFrjlp7HwQAAA==
M

```

All the code in is in the second line.

* `base64 -d` decodes base64 data from stdin
* `<<M` directs stdin from the script itself with end-of-file at the first line containing only `M`
* `|` is a pipe directing the output to
* `zcat` a gzip decompressor that reads from stdin.
* this followed by the message first gzip compressed and then base64 encoded.

Could probably be further golfed by removing line line breaks from the data and using echo instead og heardoc to store it.

I feel like I'm missing something important...

# Answer
> 5 votes
# PHP, 812

Very naive solution. I might come up with something better later.

```
<?=gzinflate(base64_decode("lZNBb9swDIXv+RUcemmDKE6aBG1623YYdthlCzAMQQ+0TdtCbNGV6CT+96NktNh62gAjDizp8fF71KEhyDHYAmxJCFwBwlGwfjpx23HNns+m4K5v6WplfIaiwbYlVxPYAMLQe+tEzwQS4EH6QcA6EFUNDXuhIFBwSXArDQ91oyso0BE662poMERBVSvB8eVuCT9JP57jTwkdujEaUrFuAZXnDo6f2Otbj8N3FQjPt41I/5RlsUbNbbUMgsWJrpPqUp1nL4OasOxCttts1w8ZhsJak78KGR+F7mIvx4Pa/kIiY8gHX8PHsvQU/rPIerfZ77KGL8ajK7kzNhjtwNRvugYn3bvlbHZz84sHDwcMp9ns0CjTV6XIN9jOtugXoLWolwmeFfD0MliVmOhHkim30FNhsQWhq4BJIaS/ieEf0kv4EXdWttAsx0XaeCY/wjf0p5IvboosVfsK2IGMfSzibd1IDEqNH2L0dKYYvnp1lXVWSJ0Vgw/J/jQFrzWnKnTFQiZTIw9T1G9DVKhQTlDx4Eo4NuTpX8irCRsm8tXDZk24Mav9bmW2+WpjkPY7c7+t8HF9j3u8f8zOli4mKPOCJv6fFXBCkeKbzQxoIoCetFHtrW35otOpJodAECdSzZN3inlSCdDaE6XutAldIVmqSMoyzleYOMb1fvA9q8r7PGLUsZgWifRb1uH/e0MipuMEPXoVsLKAPN20IITJXRD2cSFyj2h7z7XH7s2KPulaR5ImonxeaAPvLqmenc/zUT/M53BR9Q+/AQ=="));

```

# Answer
> 5 votes
# Bash (+ppmd), 588 bytes

This one beats @Dennis answer by 9 bytes, by utilizing the Prediction by partial matching compression, as implemented by the *ppmd* package (available in the official Debian/Ubuntu repositories).

**Golfed (hex dump)**

```
7461696c202d322024303e450a70706d642064204520313e262d0a6d3420
440a8fafac84a4810000f49f01005c1764584454163b8b4ebdd8f8e5852e
8649a4a01a7674929af8d6cd1d71d0758fed9551a4097e7bb3c21be619a9
ec5d7ea12677f8352b75824dc025a6c1f0b5ca6671431d03ba38e91326eb
8ea9e13a57a9607afd0ae43c8ae548ee3880197e6df9f90b4d6b45baa46b
159a15cd2993dc3f3a50d46226e301b7009174d32328bee2a7c9245a6861
779227a80ca5a016af3f08597440c86db41769b2b2b41646440eda804f9c
3b2aa70530f3080bec7acd58674a3d3b2f78f1c6674d938e415b3d07ab1e
3431a2e3165013b8251d1641f8d94be72b33aecd638d4332faa99662d848
cd5564e305b13f6ba0ccd2b105a0771ab454c417d2ebb9095291e768edde
acec556546dcf60c2cc0af962f96bb7b92d98f465bb799cd92b1b0a49a03
3261943b57a194110556ee4d39226ddfc7483ac83c6a840ba93d41ab64cf
926bbfd0423a43f7c75d73ac55d653e7de9c2d6c9508f6d371870041b133
91da72facf5b83edaf665607277384f903c1475b46e77ee58be32c6bfd5e
0eff7b206eb69b149b6649fd2f5fd933e7f8e2c61179f633551369077edb
c3de193a36f439718d0e249c04c99a88dc45ed7f4b1a8af2684d123397d9
efbca4ce93d202c7ef1f3d895fd56b655b2e34d9da1b301091e2d34e4272
342d5ea16b0973cf83dfb702009437de36f5f6292ec02aab23c3b27bb6ea
dfc40c378f61236db04dda644577114b8340ff93b65928041d8fa801f03c
abe0a89e552dc56842c5782a83992efe7200

```

**Usage**

> Please take care to pre-install *ppmd* and *m4* packages (if not installed) before running this

```
#Decode into "C"
xxd -p -r <<EOF>C
7461696c202d322024303e450a70706d642064204520313e262d0a6d3420
440a8fafac84a4810000f49f01005c1764584454163b8b4ebdd8f8e5852e
8649a4a01a7674929af8d6cd1d71d0758fed9551a4097e7bb3c21be619a9
ec5d7ea12677f8352b75824dc025a6c1f0b5ca6671431d03ba38e91326eb
8ea9e13a57a9607afd0ae43c8ae548ee3880197e6df9f90b4d6b45baa46b
159a15cd2993dc3f3a50d46226e301b7009174d32328bee2a7c9245a6861
779227a80ca5a016af3f08597440c86db41769b2b2b41646440eda804f9c
3b2aa70530f3080bec7acd58674a3d3b2f78f1c6674d938e415b3d07ab1e
3431a2e3165013b8251d1641f8d94be72b33aecd638d4332faa99662d848
cd5564e305b13f6ba0ccd2b105a0771ab454c417d2ebb9095291e768edde
acec556546dcf60c2cc0af962f96bb7b92d98f465bb799cd92b1b0a49a03
3261943b57a194110556ee4d39226ddfc7483ac83c6a840ba93d41ab64cf
926bbfd0423a43f7c75d73ac55d653e7de9c2d6c9508f6d371870041b133
91da72facf5b83edaf665607277384f903c1475b46e77ee58be32c6bfd5e
0eff7b206eb69b149b6649fd2f5fd933e7f8e2c61179f633551369077edb
c3de193a36f439718d0e249c04c99a88dc45ed7f4b1a8af2684d123397d9
efbca4ce93d202c7ef1f3d895fd56b655b2e34d9da1b301091e2d34e4272
342d5ea16b0973cf83dfb702009437de36f5f6292ec02aab23c3b27bb6ea
dfc40c378f61236db04dda644577114b8340ff93b65928041d8fa801f03c
abe0a89e552dc56842c5782a83992efe7200
EOF

#Run
bash C 2>/dev/null

#Cleanup
rm -f C D

```

# Answer
> 5 votes
# Husk, 543 bytes

```
¨ë⁶ḂcΔȦ₀fα [ȧġ:ko¦Ṁġċov-ẋΞ1y]ŀḣË¹∫⁰ Ṗn↑a₂sẏ_†¹¬Ëβḟ…cÖ¿(σ‼Ä ẏġ¬Ȧ,χg∂ηw).ẆW√ ÷hṀẏ₀fεm,ḟm [ÿ→Ȯṁ¬¥Ż'](⁸ẋ…://cθ)£⌈g.ẋKżxχg.ςm/□os/53417/⁸ÿ:-ÿ→⁰ṁ¬-►gs)†o [ëGγ⁸?Ÿ÷D](⁸ẋ…://cθ)£⌈g.ẋKżxχg.ςm/□os/15395/ȯw-ŸṙÖ-is-´-γ⁶Ÿg-Ÿ∂Δ).¶¶##γYTψ<ıT□N¹∫₇>,ẊΠȦ…¹↑ṙṘ∫ḃρ!θ a⁹←£x -ε£x₀fı≤□N.πΓÄl,ε√Yṁ⌐÷ΦcÖ¿Ä Iαmẏẏġṙ↔Ṅ¤.¶…o□√Ėα¬ΓŸïβγx↕ε□N,ε×Ẋ3£xẏo√ †oΠN↑ċnb₃‡÷[½→](⁸ẋ…://cθ)£⌈g.ẋKżxχg.ςm/Ω∟ṡ/1f731ea3-0950-4b03-ae95-24fa812a9a28/√w-Ȯ().¶¶##Ŀ=Cσ¶¶-ẏuα→⁰tα◄₇⁰ Üu▲ΨΞẊėŻ⁵←↕Ëλ;≠.¶-ïTÄẋȦ…εṗ↑₀fı≤□N¹∫ṅ ⁰ ⌉⌋ḋṡ □,ẋ'▲∂ȷ₉'it,⁸t□ḋ≠†oȮR₃i↑↕ẏo⁹ṙ.¶-ïT¹∫[ȧġ:cθ)-£⌈g],⁵o⁶‡+□{Φ¹¬**ḃŸy**Ẇ≠s!

```

Try it online!

I have just revamped the compression algorithm in Husk, making it quite a lot faster. I wanted to try it on a question with a long text to compress, and here was my occasion. This took less than two seconds to compress, so I'm happy about my revamping. It's also currently shorter than any other answer to this challenge (which I realize is quite old, but I'm happy about my compression system all the same ^^).

# Answer
> 4 votes
# PHP, 890 bytes (no built in compression)

I promised a solution less naive than gzipping (which feels too much like cheating even though it's legal here), so here it is.

```
<?php @$e=explode;$s='Thzbasic ideaKEkolmogorov-compl#ity] c:llengz`Da sejQtpuj_L^(thQgh<meX6 :s chXgeHnF). Wz:vz:HmXy of{emxfrom [BO R6@53417/ascii-bO-r6s) Z[ThzGU A&@15395/hF-rXdom-is-the-gU-a&sJYQr Task

Th`} `simil+x#cept<ijPquiPs pr_t6Kspecial V-LV?. Spec>lly,Lvery M+kdFn %<I am typ6 righjnF.

To pPvenjX _f_itzPcurs; _L},L#acjVyQ :vzDcX bzfQnH[heP~Pvis;s/1f731ea3-0950-4b03-ae95-24fa812a9a28/view-=JCl+>t;s

- YQ +znojallFeHZuszXy #$al =s likeL_$etNmeXs{atLpurposz? `nojZdFnload{`} VXHp+szitxbuj_steaHZstorzij_ yQ programN`E%-golf]xso ^_ **bytes** w_s!';$m=$e('|',', |ex|tern|code|ddPs|ar|_g|ha|ion|{aj|sQrce|ifica|of{`}|s~}s/|Zpr_j|[tag:|ow|d |).

##| of a |{z|.
- Th`|orromeX|re|ou|ettysburg|texj|an|to |shortesjcodz|in|is |t |e | th|question|](http://codegolf.stackexchange.com/');foreach(str_split('x#$%&+6:;<=>?@DEFHJKLNOPQUVXZ^_`jz{}~')as$i=>$l)$s=implode($m[$i],$e($l,$s));echo$s;

```

# Answer
> 4 votes
# Java (OpenJDK 8), 1055 bytes

```
interface T{static void main(String[]a){System.out.print("The basic idea of a [tag:kolmogorov-complexity] challenge is to print a set output in the shortest code (though that meaning has changed now). We have had many of them, from [Borromean Rings](_%s/53417/ascii-borromean-rings) to [The Gettysburg Address_%s/15395/how-random-is-the-gettysburg-address). \n##Your Task\nThis % is similar, except that it requires printing of a special text - the text of this %. Specifically, the very Markdown code that I am typing right now. \nTo prevent an infinite recursion in the %, the exact text you have to print can be found [here_revisions/1f731ea3-0950-4b03-ae95-24fa812a9a28/view-source). \n##Clarifications\n- You are not allowed to use any external sources like the internet. \n- This means that the purpose of this % is not to download this % text and parse it, but instead to store it in you program. \n- This is [tag:code-golf], so shortest code in **bytes** wins!".replaceAll("_","])http://codegolf.stackexchange.com/").replaceAll("%","question"));}}

```

Try it online!

By using `replaceAll` for some of the long strings, I saved a few bytes.

Golfed 2 bytes by putting "\](" before "\_" into the replace part.

Thanks to FlipTack for golfing 19 bytes by taking out unnecessary whitespace and unnecessary stuff! (This was a really long time; I've learned a lot since then)

Thanks to Kevin Cruijssen for golfing off a few bytes. I'm not sure how to use string formatting to help me here, unfortunately.

NOTE: This answer is now referenced here and thus cannot be golfed anymore.

# Answer
> 3 votes
# Fourier, 3359 bytes

```
84a104a-3a32a98ava115a105a99a32a105a-5a^a97a32a111a-9a32a97a32a91a116a97a+6a58a107a+4a-3a^a+2a-8a+8a+3a-3a+7a45a99a111a-2a+3a-4a-7a120a105a116a+5a93a32a99a+5a97a108aa-7a+9a-7a-2a32a105a115a32a116a-5a32a112a+2a-9a+5a+6a32a97a32a115a101a116a32a111a+6ava-4a+5ava32a105a+5a32a116a104a-3a32a115a104a+7a+3a+2a101a115a^a32a99a111a100a^a32a40a116a104a+7a+6a103a^a32a116a104a97a116a32a109a-8a97a110a-5a+5a-7a32a104a97a115a32a99a+5a97a110a-7a-2ava32a110a^a+8a41a46a32a87a101a32a104a97a118a101a32a104a97a+3a32a109a97a110a121a32a111a-9a32a116a104a-3a+8a44a32a102a114a-3a-2a32a91a66a111a+3aa-3a-2a-8a97a110a32a82a105a+5a-7a115a93a40a104a116aa-4a58a47aa99a111a100a^a+2a+8a-3a-6a46a115a^a97a99a+8a-6a120a99a+5a97a110a-7a-2a46a99a111a-2a47a113a+4a101a115a^a105a+6ava+5a47a53417o47a97a115a99a+6aa45a98a111a+3aa-3a-2a-8a97a110a45a114a-9a+5a-7a115a41a32a116a-5a32a91a84a104a-3a32a71a101a116aa+5a-6a98a117a-3a103a32a65a100aa114a101a115aa93a40a104a116aa-4a58a47aa99a111a100a^a+2a+8a-3a-6a46a115a^a97a99a+8a-6a120a99a+5a97a110a-7a-2a46a99a111a-2a47a113a+4a101a115a^a105a+6ava+5a47a15395o47a104a+7a+8a45a114a97a110a100a111a-2a45a105a115a45a116a104a-3a45a103a-2a116aa+5a-6a98a117a-3a103a45a97a+3aa114a101a115aa41a46a10aa35aa89a111a+6a-3a32a84a97a115a-8a10aa84a104a^a115a32a113a+4a101a115a^a105a+6ava32a105a115a32a115a105a+4a-4a+3a97a114a44a32a101a120a99a+2a112a+4a32a116a104a97a116a32a105a116a32a114a101a113a+4a105a+9a101a115a32a112a+2a-9a+5a+6a105a+5a-7a32a111a-9a32a97a32a115a-3a101a99a+6a97a108a32a116a101a120a-4a32a45a32a116a104a-3a32a116a101a120a-4a32a111a-9a32a116a104a^a115a32a113a+4a101a115a^a105a+6ava46a32a83a112a101a99a+6a-3a+3a99a97a108aa121a44a32a116a104a-3a32a118a101a114a+7a32a77a97a114a-7a-7a111a+8a-9a32a99a111a100a^a32a116a104a97a116a32a73a32a97a109a32a116a+5a-9a-7a+5a-7a32a114a-9a-2a^a116a32a110a^a+8a46a10aa84a111a32a112a+2a101a118a101a+9a+6a32a97a110a32a105a+5a-8a+3a+5a-5a116a101a32a114a101a99a117a-3a^a105a+6ava32a105a+5a32a116a104a-3a32a113a+4a101a115a^a105a+6ava44a32a116a104a-3a32a101a120a97a99a116a32a116a101a120a-4a32a121a111a+6a32a104a97a118a101a32a116a-5a32a112a+2a-9a+5a+6a32a99a97a110a32a98a+3a32a102a+9a+6a-7a100a32a91a104a-3a114a101a93a40a104a116aa-4a58a47aa99a111a100a^a+2a+8a-3a-6a46a115a^a97a99a+8a-6a120a99a+5a97a110a-7a-2a46a99a111a-2a47a114a101a118a105a115a105a+6ava+5a47a1o102a731o101a97a3o45a0o950o45a4o98a0o3o45a97a+4a95o45a24o102a97a812o97a9o97a28o47a118a105a-4a119a45a115a-4a+6a-3a99a+2a41a46a10aa35aa67a108a97a114a-9a-3a+3a99a97a116a105a+6ava+5a10aa45a32a89a111a+6a32a97a114a101a32a110a^a+5a32a97a108aa+3a+8a101ava32a116a-5a32a117a-2a101a32a97a110a121a32a101a120a-4a101a114a-4a97a108a32a115a-4a+6a-3a99a+2a115a32a108a-3a+2a-6a32a116a104a-3a32a105a+5a+6a101a114a-4a-9a116a46a10a45a32a84a104a^a115a32a109a-8a97a110a+5a32a116a104a97a116a32a116a104a-3a32a112a+5a-3a-2ava+4a101a32a111a-9a32a116a104a^a115a32a113a+4a101a115a^a105a+6ava32a105a115a32a110a^a+5a32a116a-5a32a100a111a+8a-9a-2a+3a97a+3a32a116a104a^a115a32a113a+4a101a115a^a105a+6ava32a116a101a120a-4a32a97a110a100a32a112a97a114a^a101a32a105a116a44a32a98a117ava32a105a+5a+5a^a101a97a+3a32a116a-5a32a115a^a-5a+3a101a32a105a116a32a105a+5a32a121a111a+6a32a112a+2a-3a-8a114a97a109a46a10a45a32a84a104a^a115a32a105a115a32a91a116a97a+6a58a99a111a100a^a45a103a+8a-3a-6a93a44a32a115a-4a32a115a104a+7a+3a+2a101a115a^a32a99a111a100a^a32a105a+5a32a42aa98a121a-5a101a115a42aa32a119a105a+5a+5a33a

```

Uses isaacg's program to golf the program. This can likely be shortened even more using variables.

# Answer
> 3 votes
# ///, ~~976~~ 961 bytes

```
/?/ code //_/shortest?//^/text //@/the//$/ the //&/ to //`/question//~/codegolf.stackexchange.com/The basic idea of a [tag:kolmogorov-complexity] challenge is&print a set output in$_(though that meaning has changed now). We have had many of @m, from [Borromean Rings](http:\/\/~\/questions\/53417\/ascii-borromean-rings)&[The Gettysburg Address](http:\/\/~\/questions\/15395\/how-random-is-@-gettysburg-address).

##Your Task

This ` is similar, except that it requires printing of a special ^-$^of this `. Specifically,$very Markdown?that I am typing right now.

To prevent an infinite recursion in$`,$exact ^you have&print can be found [here](http:\/\/~\/revisions\/1f731ea3-0950-4b03-ae95-24fa812a9a28\/view-source).

##Clarifications

- You are not allowed&use any external sources like$internet.
- This means that$purpose of this ` is not&download this ` ^and parse it, but instead&store it in you program.
- This is [tag:code-golf], so _in **bytes** wins!

```

*-15 bytes thanks to steenbergh*

Try it online!

# Answer
> 2 votes
## HTML, ~~1082~~ 1072

With the same text font :P The end tag `</pre>` is not necessary.

```
<pre>The basic idea of a [tag:kolmogorov-complexity] challenge is to print a set output in the shortest code (though that meaning has changed now). We have had many of them, from [Borromean Rings](http://codegolf.stackexchange.com/questions/53417/ascii-borromean-rings) to [The Gettysburg Address](http://codegolf.stackexchange.com/questions/15395/how-random-is-the-gettysburg-address).

##Your Task

This question is similar, except that it requires printing of a special text - the text of this question. Specifically, the very Markdown code that I am typing right now.

To prevent an infinite recursion in the question, the exact text you have to print can be found [here](http://codegolf.stackexchange.com/revisions/1f731ea3-0950-4b03-ae95-24fa812a9a28/view-source).

##Clarifications

- You are not allowed to use any external sources like the internet.
- This means that the purpose of this question is not to download this question text and parse it, but instead to store it in you program.
- This is [tag:code-golf], so shortest code in **bytes** wins!

```

# Answer
> 2 votes
# Octave, 1017

Strightforward with two substitutions, I do not think it is possible to reduce even more.

```
 q='question';s='http://codegolf.stackexchange.com/';disp(['The basic idea of a [tag:kolmogorov-complexity] challenge is to print a set output in the shortest code (though that meaning has changed now). We have had many of them, from [Borromean Rings](',s,q,'s/53417/ascii-borromean-rings) to [The Gettysburg Address](',s,q,'s/15395/how-random-is-the-gettysburg-address).\n\n##Your Task\n\nThis ',q,' is similar, except that it requires printing of a special text - the text of this ',q,'. Specifically, the very Markdown code that I am typing right now.\n\nTo prevent an infinite recursion in the ',q,', the exact text you have to print can be found [here](',s,'revisions/1f731ea3-0950-4b03-ae95-24fa812a9a28/view-source).\n\n##Clarifications\n\n\n- You are not allowed to use any external sources like the internet.\n- This means that the purpose of this ',q,' is not to download this ',q,' text and parse it, but instead to store it in you program.\n- This is [tag:code-golf], so shortest code in **bytes** wins!'])

```

# Answer
> 2 votes
# Vyxal, 661 bytes

```
`λƛ »ǔ †₁ of a [ƈ↲:k꘍Ġ꘍τrov-₁µ] ɾṖ is to ⟑Ẇ a ƛ⊍ ∆ė in λλ ×¶½Ḣ ¬⋎ (»⟇ λ⟇ ↓₅ λβ ⌐ƈ λṠ). We λʁ λ‡ ƛ≤ of ƛ‹, λø [Bor←„an ↓₄](ṅ•://¬⋎»₅.⟩β•∵•⅛/∨§/53417/Ġ₴-ǍḂ←„an-↓₃) to [λƛ λŻ≠ŻǍṪg ¬Ġ](ṅ•://¬⋎»₅.⟩β•∵.•⅛/∨§/15395/λ₴-⌐‡-is-λλ-λẎ≠ŻǍṪg-¬Ḟ).

##λ⌐ ʀǓ

λ« ⟇Ṡ is ÷₃, øṄ λ⟇ it ↔ƒ ɽǔ of a ¬∪ ∧□ - λλ ∧□ of λ× ⟇Ṡ. ∵‟, λλ ƛ² «Ċ∧ċ ¬⋎ λ⟇ I am Ȯ» ¬ẋ λṠ.

To ɾ₃ an ĿẎ ¡⁺ꜝµẏḂ in λλ ⟇Ṡ, λλ →æ ∧□ λ• λʁ to ⟑Ẇ λ‹ be ∧½ [λḞ](ṅ•://¬⋎»₅.⟩β•∵.•⅛/Ẋ₁/1f731ea3-0950-4b03-ae95-24fa812a9a28/λ₌-⟑Ḋ).

##C⇧ċ⋏↓¢₌ẏḂs

- λß λ½ λ† ⌐⁰ to λ₇ λ¶ ↔ċ €ƈ λƒ λλ ¬Ḋ.

- λ« ×Ḣ λ⟇ λλ †¯ of λ× ⟇Ṡ is λ† to ∧ẋ λ× ⟇Ṡ ∧□ λ¬ ḟ⋎se it, λė ∆» to ¬↓ it in λ• ƛ¾.

- λ« is [ƈ↲:¬⋎-»₅], so ×¶½Ḣ ¬⋎ in **¨ƈ** ṅ↓!

```

Try it Online!

Probably not a winner, but it was fun.

# Answer
> 1 votes
# Python 2, 988 bytes

I use a simple string substitution. Still golfable...

```
print"""The basic idea of a [tag:kolmogorov-complexity] challenge is to print a set output in the shortest code (though that meaning has changed now). We have had many of them, from [Borromean RingsZQs/53417/ascii-borromean-rings) to [The Gettysburg AddressZQs/15395/how-random-is-the-gettysburg-address).

##Your Task

This Q is similar, except that it requires printing of a special text - the text of this Q. Specifically, the very Markdown code that I am typing right now.

To prevent an infinite recursion in the Q, the exact text you have to print can be found [hereZrevisions/1f731ea3-0950-4b03-ae95-24fa812a9a28/view-source).

##Clarifications

- You are not allowed to use any external sources like the internet.
- This means that the purpose of this Q is not to download this Q text and parse it, but instead to store it in you program.
- This is [tag:code-golf], so shortest code in **bytes** wins!""".replace('Z',"](http://codegolf.stackexchange.com/").replace('Q',"question")
```

# Answer
> 1 votes
# SOGL 0.8, 571 bytes (non-competing)

```
""%I│Γ"J∞‛█Τ∙‚+∑(4░║ρ│oΛe2ρ′╗m↔←A<¡►&ŗNō▼ΥικVf÷!╗‼ξ┐Wο1 sY¬ƨ⁾¡»╬j§4¡η╬Σεxτ§¼rķ(Λ‽Kp√½ΗφW≡fC╚⁹≠╬Βηs0θ⅓I+žπƨΒY³Pu⁽šnχ~░5u►℮O¹o│≈+Δ┐š;ΜTV)wm⌠⁄υ∞1;gγ¼τωΚ■FR░ŗΤ`∞‰ŗ⌡šZž█GνhΗ)Δo▲`℮↔uξxKΤ4└χ…⁄ŗ╝cJē∙ΒΤi%⁽Σσk÷YΨ►l"βj;σoƨΩ╚↔f5$φvhē≠¦jO⌠T[±žν⅛◄bk⅜³β⅜UEΙ′Η--<~Y′¦!πƧ⁾=╥ν#○∙2¡TFpπō┌↑# ±⌠℮¬‰Τ>⌠t⅝>ķ'¶↓+w(½⁷↑ø#Ξ%:║θ↕↑DƧ⅞℮5Rr⁴,«xģΜ5Χ▓#⁸\‼∞f.xΣ╬≤∑ΛB;Ο/Sšδ‚^Λ½0S/≥E=÷℮YεDHψκhψB~ν⅓┌e>#∙0℮|θR⁸½N…1─ķφ∙Y⁵№Χ$gx:χZō┐Δ=░⁄κ§o□π|÷øΣxē′↓Κηπε\╤⁽Ιβiμ^ņμΦƧK℮Δnε{ΩA7≠ΓIw¶¤╥γ╝δΞ▼□╚¼Uf↔mK←G▓a⁴ηē¦CΓ°⁵⁄χwƧB2h⌠↓■ņ-AΛ∆Y⅟VYK0○4Gx↕┐ķk#ž6æ3►ΘšXΤΕ█Rtε{►n‰6mI-υō⁰┼¶BķT³‘ ^"≠‚z|√λ⅜…w╝_└b′℮Χ]υ:.▒█m≤↔t§)U█ā⅛□⁸S$/‘ŗ

```

Expect this to be golfed some more.

Basically a compressed string (english words and characters) with `s](http://codegolf.stackexchange.com/questions/` replaced with `^` and replaced back.

# Answer
> 1 votes
# Dyalog APL, 638 bytes

Requires `⎕IO←0`. For `⎕IO←1` just change `¯128` to `¯129`.

```
0(220⌶)¯2(219⌶)¯128+⎕AV⍳')lec;∣↑å⍒3ÌV@Ìé*↓!K⍺┤>N.ÒrÌrkV|≡î%ta⍲#=ê¿┴´∇Ì;¿⍬┌u⍱2ØZ&C↑áa€ÛË}QOG⍀@ÍÛõÒÔþö&7á;⍺┌íp⌹,0ê<ÐîÏ⊢$`⊃´´@äz0┐R⊖Û)ä⍒
`⌹v∨P\X,Ô4─9Ã   AâäàZ¨ɫz¶┤Úà∊Ø⍴81⍱ýHâ⍳⋄ ⍋kññÝ;⍪T⍟↑ã)(¶>ääÁw âMîà    #∇
JYâ→Ô¯cö.CíæÕìíá¡⍣g┬q⍋`ûÓïɫ∪mbÎ┘l@ä
hPVðü$┌·┴Ìß¯ö⊣>t┘åà$ÐÄ%⍵D∩õ§:⌈¥×⌹⍉⊣⊤ɫ?WM⊂^Ð≡(*uÒdã⍟⊂⍪þ3.Bt (o!NO¢AAë}⍞⍳Y⌊BÝ⊖+ÕþS∊ï⌽∊Î(ASà⍺\É∊ç  ⍞<ï¡Û∪êñ´┼⊂↓xî,€[ï⊣≤∪⍬Á┴ußI¿lE
Ñ¿≥§⍋7~ÒQtH├5⍫'

```

`'`...`'` the string consisting of the following bytes: **<sub><sup>F8 1C 15 13 C1 EE 5B B0 90 C5 33 68 56 E7 68 94 D9 B4 B1 CC 4B 0E E3 A4 4E 2E 6D 22 68 22 1B 56 C0 D1 98 D9 0C 24 11 C4 D8 A2 95 F2 E4 DB B7 68 C1 F2 2F DE 25 C3 32 89 5A 2C DA 43 B0 8D 11 7C 73 67 7D 51 4F 47 9F E7 69 73 7A 6D 6F 75 D5 DA 37 8D C1 0E DE 97 20 CB C2 30 95 A0 6C 98 6B 3B 3D ED BB DB DB E7 8F 2A 30 DD 5F 52 C9 73 F8 8F C5 03 ED CB 26 A6 50 9E 58 C2 6F 34 E1 39 63 09 41 8E 5C 8F 8C 5A 80 0B 2A EF 2C E3 72 8C 05 AD 89 AE 38 31 C3 5D 48 8E B2 F4 04 C6 1B 9A 9A 74 C1 D0 54 CA B0 76 F8 B9 07 EF A4 8F 8F 61 27 04 8E 4D 98 8C 09 D8 B7 03 4A 59 8E F6 6F 2D 13 D5 2E 43 97 91 70 77 97 8D F3 FF 17 E5 21 C6 ED 5B EA 6E 99 0B BD 1D 12 6A DC 1C E7 8F 03 18 50 56 78 EC 3D 3A DE 5E E4 68 8B 2D D5 7E A4 24 DC 90 3A 8C 3D 6C 82 0C 0F 44 BC 7A FC F0 B5 3C AB CB C7 7E BF 0B AC 57 2B 4D BA EB 6C D1 B9 B4 25 6D 14 76 CA BA D0 75 33 2E 42 24 FB B9 1F CC 4E 4F 3F 5B 41 41 96 7D FE B2 59 B6 42 74 C9 A9 70 75 3A 53 AD 3A 99 C8 AD 6A B9 41 53 8C 0E 9E 86 AD 92 09 FE A0 99 F3 73 BD 95 9A DB E0 BA B1 28 98 C2 7C 9B 99 7E A1 BD 07 2F 61 E4 25 8B 49 F2 1C 45 03 87 F2 A3 FC C6 37 AF 6D 51 24 48 E2 35 CF 00 9D 70 58 07 A2 CE 57 8D 07 20 44 78 B6 C4 CF 87 8A 61 0B D7 D3 E9 23 19 44 D9 B1 B8 9F 6D 27 A9 F8 2A 19 2A 50 89 8B CE 26 C6 BB 24 28 1F 07 28 90 21 1C 20 32 03 A9 E1 57 10 23 FF A1 AF A6 34 CF 64 2B 1B 55 12 F0 25 96 1B 75 C2 DD 67 0B 15 C2 5A 2C 55 55 F5 05 37 4B AB 5C 60 55 ED F6 50 F4 D4 DE 18 97 14 78 FF 90 40 91 C5 0C EF B2 D1 A0 09 80 BA 12 C6 25 37 36 35 C7 19 CE B1 B9 F8 02 B0 11 E2 1E 1C 91 4C C9 45 C3 2B 77 94 3B 13 A6 E4 07 F8 AE A2 B1 4B B0 DF BE F1 8C 7B 7D 60 FA AB AA AF 73 88 D1 07 E2 D2 A4 50 EF 2D 8C 7F 5F 87 A2 B1 99 A7 68 51 09 00 66 99 64 71 CD 73 CC 98 5D F9 36 AE EC 84 6E 81 ED 6F EC 6D 30 FB 36 A2 5F 78 DA 87 12 AA 20 3C 1F C9 83 AF DE D2 39 BB 1D 66 23 BC 18 CE 61 A8 6A EF 4E FE 81 AC 8C F9 B3</sup></sub>**

`⎕AV⍳` indices of the characters in the **A**tomic **V**ector (the character set)

`¯128+` subtract 128 to get 8-bit signed integers

`¯2(219⌶)` zlib decompress

`0(220⌶)` deserialize array

# Answer
> 1 votes
# Javascript (ES6), 887 bytes

```
s=`Th"basic=dea ¢¦kolmog>ov-complexDy] c&lleng"H<z a se$outputEJ§(though%&$me6O&s c&nge?now). W"&v"&?m6y of%hemLfrom [B_ R+gsZ53417/ascii-b_-r+gs)<[Th"GV AjZ15395/how-r6dom-H-the-gV-aj{Your Task

TUPsimilFLKcept%&t=$@quir' zO¢sXalN-JtK$¡. SXfically,Jvery MFk£ Q"t&$I am%ypOrigh$now.

To preven$6Ef+D"@cursionEJqu'|,JKactN¤&v"to pr+$c6 b"foun?[he@^@vHions/1f731ea3-0950-4b03-ae95-24fa812a9a28/view-}ce{ClFifica|s

- You F"no$allowed<us"6y K~al }c' lik"th"+~et¥hH me6s%&tJpurpos"¡Pnot<£load%UN6?pFs"DLbutEstead<st>"DE ¤program¥hHP¦Qe-golf]Lso §+ **byt'** w+s!`
for(i in a=`§¦¥¤£P¡~}|{N@DEFXUJK¢OzLjVHZ^<_'Q6?+&$>%="`)s=s.split(a[i]).join(`sh>t'$Q";[tag:;.
- T;you ;down;=s ;of%U;tern;sour;tion;).

##;%K$;re;it;=n;ar;peci;hH qu'tion;%h";ex;of a ;+g ;pr+t;, ;ddr's;ettysburg;is;^qu'tions/;](http://Qegolf.stackexc&nge.com/;%o ;>rome6;es;cod;an;d ;in;ha;t ;or; t; i;e `.split`;`[i])
alert(s)
```

String replacement taken to the extreme.

## Explanation

```
s=`...`                     // The compressed string
a=`...`                     // List of characters to replace
b=`...`.split`;`            // List of replacements
for(i in a)                 // For every index in a
  s = s.replace(a[i], b[i]) // Replace every occurence of a[i] in s with b[i]
alert(s)                    // Print the result

```

# Answer
> 1 votes
# 05AB1E, ~~658~~ ~~587~~ 586 bytes

```
¶2×UžX’(ÿƒËŠˆ.Â‚‹º.ŒŒ/…é/’V’½¨›Ú€¬¾ãÒ²Ñ›’™X„##«©•Xć-.ʒ¦a‘lsØ¥Ê™´XE×•h6'-:lY'†ä'¥±:’ÿÿ/€×-…ï)’'€Î’Ï›Ò¢s¾ß’'€„™X’‰©„‹’™'¥Ï™'€Œ™X„€žšª™®.•p4ÊĆιÅ•©Žy!Y’ÿÿ/€ß-ïÊ-€ˆ-€€-ÿ-ƒ¹)’®’[€€ ÿ ƒ¹]’™ŽÒ`Y’ÿÿ/Ø®-ßßr«Ä€¤-£Ç)’’[ßßr«Ä€¤ £Ç]’™'€¦™'‰Ò’ [Ÿ¾:å±ëºå¯€—ov-ÄÕ]’'€€™“ÿŠµŽ©€‚€…ÿ›Ý€ˆ€„…¢€…‚áîÕ€†€€ˆ¶estƒË (ÿ€Š£È€°ï‚€Ó). ÿ€¡‚†‚Ü€‚‚¨,€š ÿÿ€„ ÿÿ.ÿÿÿÿ†ä€ˆ‡Å,•Ý€Š€•–ßœæ€‚€…ƒÑ„¹ -€€„¹€‚€Œ†ä. ÿ,€€‚Ò ÿƒË€Š I€ÜÜÔƒ©€Ó.ÿÿ›Ë€¤ÚÕ ÿ€†€€†ä,€€ª‚„¹€î€¡€„…¢€©€ïƒç [ÿ]ÿ.ÿÿ
“?…
- U'¡Ï’ [Ÿ¾:ƒË-Šˆ]’'€Œ™X‚2и`'€î™X“ÿÿ€™€–ï¶€„€Å€Æ–²Žç€è€€ƒ¸.ÿÿˆ¾€Š€€ŽÂ€‚€Œ†ä€ˆ€–€„„ï€Œ†ä„¹€ƒ³™se€•,€³î¿€„ƒï€•€†€î‚ë.ÿÿ€ˆÿ,€Êˆ¶estƒË€† **ÿ**·Ñ!“,

```

Try it online!

# Answer
> 1 votes
# Python 3, 950 bytes

```
s='''The basic idea of a [tag:kolmogorov-complexity] challenge ßto print a set output ināá(though â àing has changed now). We have had many of them, from [Borroà Rings]æås/53417/ascii-borroà-rings) to [The Gä Address](æås/15395/how-random-is-the-gä-address).

##Your Task

Tãå ßsimilar, except â it requires printing of a special text -ātext of tãå. Specifically,āvery Markdown code â I am typing right now.

To prevent an infinite recursion ināå,āexact text you have to print can be found [here]ærevisions/1f731ea3-0950-4b03-ae95-24fa812a9a28/view-source).

##Clarifications

- You are not allowed to use any external sources likeāinternet.
- Tãàs âāpurpose of tãå ßnot to download tãå text and parse it, but instead to store it in you program.
- Tãß[tag:code-golf], so áin **bytes** wins!'''
for x in zip('æãåāàáâäß','(http://codegolf.stackexchange.com/,hß,question, the ,mean,shortest code ,that,ettysburg,is '.split(',')):s=s.replace(*x)
print(s)

```

Try it online!

Still not optimal...

# Answer
> 0 votes
## Java 1130 bytes

```
import java.io.*;import java.util.*;import java.util.zip.*;public class P{public static void main(String[]a)throws Exception{InputStream s=new InflaterInputStream(new ByteArrayInputStream(Base64.getDecoder().decode("eNqUk0Fv2zAMhe8F+h849NIGUdw0Ddr0tu0w7LDLFqAYgh5om7aF2JIr0Un870fKSLf1tAFB4sjSx8f3qG1DkGO0BdiSEHwFCDvG+mnv287XPviDKXzXt3SyPL5A0WDbkqsJbAT20AfrWM5EYvAD9wODdcBCjY0PTJGh8CXBNTd+qBt5gwwdobOuhgajAoVWgvPHmwU8kywe9KuEDt2oggTWzaEKvoPdJx/kV47DdwHEl+uGuX/KMq1R+7ZaRMZiT6eJuhDl2esgIqx3MVuv7pcPGcbCWpOfQSYo6EZ72W1F9hdiHmM+hBo+lmWg+J9FluvVZp01/mgCutJ3xkYjHZj6jWtw4t4sLi8uL66ufvohwBbjXv9uG/H1TFOPo+1si2EOUo96ngy0DIFeByuYKQF1M2UXeyostsB0YjApiPSYfPwDvYAfurOyheQ5ztPGA4URvmHYl/7opthSta+AHfDYa5Fg64Y1rCR+qwNAB9IRELWuss4yibZiCDE1MM3CuepUh05Y8CRr9MMU+NsoFQLKCSo/uBJ2DQX6F/9FhI2T/9XDakm4Mreb9a25z29XBmmzNnf3FT4u73CDd4/ZwdLRRPG9oHMKn8XkZEeKUdcMSDKAgaRd6a9t/VHmVIQOkUBnUxqg4MTsiRShtXtKHUoj8oZ4oZQUqY5anOzUDf0Qei+Y97Fo4lpNqmgIrZd78PeGZJtMFvQYBGB5Dnm6dJEJk7zIPugLNV/97YOvA3a/tcgnXXH106ihL3Np4d2FlcOzWT7KwmwGR8F/+AUAAP//".getBytes())));int i=0,n=1067;byte[]r=new byte[n];for(;i<n;i++){r[i]=(byte)s.read();}System.out.println(new String(r));}}

```

An `InflaterInputStream` that reads the bytes from a hard-coded String that contains the Base64-encoded, ZIPped data of the post.

Not very impressive, but at least that's 15 bytes less than the naive version that just prints the string:

```
public class Q{public static void main(String[]args){System.out.println("The basic idea of a [tag:kolmogorov-complexity] challenge is to print a set output in the shortest code (though that meaning has changed now). We have had many of them, from [Borromean Rings](http://codegolf.stackexchange.com/questions/53417/ascii-borromean-rings) to [The Gettysburg Address](http://codegolf.stackexchange.com/questions/15395/how-random-is-the-gettysburg-address).\n\n##Your Task\n\nThis question is similar, except that it requires printing of a special text - the text of this question. Specifically, the very Markdown code that I am typing right now.\n\nTo prevent an infinite recursion in the question, the exact text you have to print can be found [here](http://codegolf.stackexchange.com/revisions/1f731ea3-0950-4b03-ae95-24fa812a9a28/view-source).\n\n##Clarifications\n\n- You are not allowed to use any external sources like the internet.\n- This means that the purpose of this question is not to download this question text and parse it, but instead to store it in you program.\n- This is [tag:code-golf], so shortest code in **bytes** wins!");}}

```

# Answer
> 0 votes
# Python 2.7 - 843 bytes

Nothing interesting here. Just a base64-encoded gzip of the string. I'm sure there are better ways to encode it, but I couldn't figure out how to put it into a file in a way that python can later read it.

```
import zlib
print zlib.decompress("#eJyVk0Fv2zAMhe/5FRx6aYMoTpoEbXrbdhh22GULMAxBD7RN20Js0ZXoJP73o2S02HraACMOLOnx8XvUoSHIMdgCbEkIXAHCUbB+OnHbcc2ez6bgrm/pamV8hqLBtiVXE9gAwtB760TPBBLgQfpBwDoQVQ0Ne6EgUHBJcCsND3WjKyjQETrramgwREFVK8Hx5W4JP0k/nuNPCR26MRpSsW4BlecOjp/Y61uPw3cVCM+3jUj/lGWxRs1ttQyCxYmuk+pSnWcvg5qw7EK222zXDxmGwlqTvwoZH4XuYi/Hg9r+QiJjyAdfw8ey9BT+s8h6t9nvsoYvxqMruTM2GO3A1G+6Bifdu+VsdnPziwcPBwyn2ezQKNNXpcg32M626BegtaiXCZ4V8PQyWJWY6EeSKbfQU2GxBaGrgEkhpL+J4R/SS/gRd1a20CzHRdp4Jj/CN/Snki9uiixV+wrYgYx9LOJt3UgMSo0fYvR0phi+enWVdVZInRWDD8n+NAWvNacqdMVCJlMjD1PUb0NUqFBOUPHgSjg25OlfyKsJGyby1cNmTbgxq/1uZbb5amOQ9jtzv63wcX2Pe7x/zM6WLiYo84Im/p8VcEKR4pvNDGgigJ60Ue2tbfmi06kmh0AQJ1LNk3eKeVIJ0NoTpe60CV0hWapIyjLOV5g4xvV+8D2ryvs8YtSxmBaJ9FvW4f97QyKm4wQ9ehWwsoA83bQghMldEPZxIXKPaHvPtcfuzYo+6VpHkiaifF5oA+8uqZ6dz/NRP8zncFH1D78BIl92mw==".decode('base64'))

```

# Answer
> 0 votes
## bash, 870 chars

```
echo "-----BEGIN PGP MESSAGE-----
owGVk7Fu2zAQhod20lNckSU2TCuOYyTO1nYoOnRpDbSFkeEknSTCEqmQJ9t6qL5K
n6hDjyQStJlaQLAMkfzvv+8//ng9K16hr76VP3/tWoICvS5BV4Rga0DYMzb3B9v1
trHOHlVp+6Gjs+bpAcoWu45MQ6A9sIXBacNyxhODHXkYGbQBFlXfWsfkGUpbEVxy
a8emlRVk6AmNNg206IOgqFVg7Gm2hK8kH4/hp4IezRQMiVi/gNrZHvbvrJO3HIfP
IuAfLlvm4T7PQ43GdvXSM5YHOifVpTjPH0cxoa3x+WZ9s7rN0Zdaq+JJSLkgNAu9
7AOMD8Q8+WJ0DbytKkf+P4usNuvtJm/tSTk0le2V9ko6UM2zrsKkO1tm2cXFdzs6
2KE/ZNmuFaZPSoGv173u0C1AatHACZ5mcPQ4apFI9APJmJsfqNTYAdOZQcUQ4t/I
8A/pJXwJO2tdSpbTIm48kpvgE7pDZU8mRRarfQTsgachFHG6aTkEJcZ3IXo6Ughf
vJpaG80kzsrR+Wg/TcFTzVSFzlhyMjXZMUX9PESlCBUEtR1NBfuWHP0LeTGhfSJf
365XhGt1td1cqZviaq2Qtht1fVPj3eoat3h9lx81nZQX5iUl/u8FcEQR48syBZII
oCNpVHrrOnuS6RSToycIEynmyRnBnFQ8dPpAsTtpQlaIlyISswzz5RPHsD6MbrCi
8jKPEHUoJkUC/c7K8P+9IRKTcYIBnQhoXkARb5pnwujOs3VhIXAPaAdnG4f9sxV5
4rUOJFVA+bCQBl5cUjk7nxeTfJjP4STqb7Lf
=g2Th"|gpg -d 2>&0

```

Message was produced with `gpg --store file` and some extra stuff was shaved off. Kind of just wanted to see if it could be done.

# Answer
> 0 votes
# Python 2, 826 bytes

```
print"eJyVk0Fv2zAMhe/5FRx6aYMoTpoEbXrbdhh22GULMAxBD7RN20Js0ZXoJP73o2S02HraACMOLOnx8XvUoSHIMdgCbEkIXAHCUbB+OnHbcc2ez6bgrm/pamV8hqLBtiVXE9gAwtB760TPBBLgQfpBwDoQVQ0Ne6EgUHBJcCsND3WjKyjQETrramgwREFVK8Hx5W4JP0k/nuNPCR26MRpSsW4BlecOjp/Y61uPw3cVCM+3jUj/lGWxRs1ttQyCxYmuk+pSnWcvg5qw7EK222zXDxmGwlqTvwoZH4XuYi/Hg9r+QiJjyAdfw8ey9BT+s8h6t9nvsoYvxqMruTM2GO3A1G+6Bifdu+VsdnPziwcPBwyn2ezQKNNXpcg32M626BegtaiXCZ4V8PQyWJWY6EeSKbfQU2GxBaGrgEkhpL+J4R/SS/gRd1a20CzHRdp4Jj/CN/Snki9uiixV+wrYgYx9LOJt3UgMSo0fYvR0phi+enWVdVZInRWDD8n+NAWvNacqdMVCJlMjD1PUb0NUqFBOUPHgSjg25OlfyKsJGyby1cNmTbgxq/1uZbb5amOQ9jtzv63wcX2Pe7x/zM6WLiYo84Im/p8VcEKR4pvNDGgigJ60Ue2tbfmi06kmh0AQJ1LNk3eKeVIJ0NoTpe60CV0hWapIyjLOV5g4xvV+8D2ryvs8YtSxmBaJ9FvW4f97QyKm4wQ9ehWwsoA83bQghMldEPZxIXKPaHvPtcfuzYo+6VpHkiaifF5oA+8uqZ6dz/NRP8zncFH1D78BIl92mw==".decode('base64').decode('zip')

```

Try it online!

Very boring, just a `zip`, `base64`encoding.

# Answer
> 0 votes
# Windows Batch, ~~1103 1061~~  1040 bytes

```
@echo off
set _=question
set l=](http://codegolf.stackexchange.com/
set e=echo(
%e%The basic idea of a [tag:kolmogorov-complexity] challenge is to print a set output in the shortest code (though that meaning has changed now). We have had many of them, from [Borromean Rings%l%%_%s/53417/ascii-borromean-rings) to [The Gettysburg Address%l%%_%s/15395/how-random-is-the-gettysburg-address).
%e%
%e%##Your Task
%e%
%e%This %_% is similar, except that it requires printing of a special text - the text of this %_%. Specifically, the very Markdown code that I am typing right now.
%e%
%e%To prevent an infinite recursion in the %_%, the exact text you have to print can be found [here%l%revisions/1f731ea3-0950-4b03-ae95-24fa812a9a28/view-source).
%e%
%e%##Clarifications
%e%
%e%- You are not allowed to use any external sources like the internet.
%e%- This means that the purpose of this %_% is not to download this %_% text and parse it, but instead to store it in you program.
%e%- This is [tag:code-golf], so shortest code in **bytes** wins!

```

# Answer
> 0 votes
# Jelly, 604 bytes

```
“¥yL⁹ ŻḌsŻṡþ}ḥṖỊⱮĿs\²[Ɱġ}ŀ}ṁẈṂDFṾ§HŻĿỌḅṙṣȦȧḊŒ⁾ȥ\ɠ5¥ḤḞṭWGḥL|ẠƥṁỌ¥⁸5 sæµƬṪ)Ƈṡẹ§+ḋb³⁻ỵḊYƲẹṫæĠYhḄdḅP⁻ḞO3kḳṡ¹ßẎṖ¢ẉ⁺Ɲ¢ÞịċḄẋɱṢḲPẒ3ƥŀl{eµ*⁵ịlGƭṄɼṅỊKḂ:ŒɓɼḃɠƝWʂż⁶ɼƊ8;ɦT½yFƭÞ¥$0UɠẆvṫ>P⁼un 6:ḥ{Ẹ!*ḃ~⁵ƈÑµẋ_-d²ḂȮVġPFølƤGrị0£ṁfẋOḅṪHƥṄḌỤ1⁷ƓĿ¶Ŀ,D]Oẹ6'¥ịFỊç4Øuȧʋ5iɦịlnġ7V¡Z©|¢:⁽£Ñ¬Ƒ.$ḟṫÆỤọƭḊṡÆƬ⁴eɠµv)ẆṛPɓż½ƭQŀ_Þ:a^xrƝ(¬Ʋ7ḄjCḅ"DɲṆĖGẒɱ⁻L#¿Ṙñq¶¬bỌÐ½ßẉ⁼ċ`ṄⱮƝƑ⁼w¦Ḍḍ3hiƓ⁹ḌɠṅȦZṘỴḋḤzḟQ/ɦf®⁷Þnİṁ}ṫ.~ŀ£ȯÐṭ2Ṅ*%6ßƭu\{²ȥ/mƤaṛ`ẋỵ⁴ż°ḢgµḋCḍṫɦ%XƝėælĊƈ+Ɱ+Lṅwuo9ƁM÷ðĊɱṙƝıƒpEƊȥọDØ&ṙḊƓ×⁻?ḥẎ6o¥ḂKċþzȥ!(zzḟḋỌ2YĊ{dɲṣⱮẉ!ƒwŒ½Ḷ9ṗ7(ȥẊJDḤḞ(Iḃŀø¶ċ}ɼMṢƭrx:ṅ.4ɱḶ8ẠfBḳƈ¢s$ĖḥŻƥfeß=Gs3cO⁶ÄfṗƬṫqʋ!ṭɼȥṅƈ|¦¶ḋL¢ṭỤĖçġøṭg,Ọw_⁾7ACṛ¿RP4Yoḳr²ʂñ²ỴƓẊṆ;QẇṫḃḶñ¹H§AĊ6(⁴ṡ@»

```

Try it online!

Jelly's compression is not the best out there.

---
Tags: code-golf, kolmogorov-complexity
---


title: Lay out the Carpet

text:
# Question
Title: Lay out the Carpet
Inspired by this SO question.

## Challenge:

**Input:**

* A string \\$s\\$
* A character \\$c\\$

**Output:**

Create a diamond-square ASCII art of the string in all four directions, with the first character of the string in the center and going outwards. Which is inside a square ASCII-art carpet, with the character as filler. This may sound pretty vague, so here's an example:

Input: \\$s\\$ = `string`, \\$c\\$ = `.`
Output:

```
..........g..........
........g.n.g........
......g.n.i.n.g......
....g.n.i.r.i.n.g....
..g.n.i.r.t.r.i.n.g..
g.n.i.r.t.s.t.r.i.n.g
..g.n.i.r.t.r.i.n.g..
....g.n.i.r.i.n.g....
......g.n.i.n.g......
........g.n.g........
..........g..........

```

## Challenge rules:

* Input-string may also be a list of characters
* Output may also be a list of string-lines or matrix of characters
* Input-string and character are guaranteed to be non-empty
* The string is guaranteed to not contain the character
* Both string and character will only be printable ASCII (unicode range \[32,126\], space ' ' to and including tilde '~')

## General rules:

* This is , so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
* Standard rules apply for your answer with default I/O rules, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
* Default Loopholes are forbidden.
* If possible, please add a link with a test for your code (i.e. TIO).
* Also, adding an explanation for your answer is highly recommended.

## Test cases:

Input: \\$s\\$ = `11111`, \\$c=\\$ = `0`
Output:

```
00000000100000000
00000010101000000
00001010101010000
00101010101010100
10101010101010101
00101010101010100
00001010101010000
00000010101000000
00000000100000000

```

Input: \\$s\\$ = `12345ABCDEF`, \\$c\\$ = `#`
Output:

```
####################F####################
##################F#E#F##################
################F#E#D#E#F################
##############F#E#D#C#D#E#F##############
############F#E#D#C#B#C#D#E#F############
##########F#E#D#C#B#A#B#C#D#E#F##########
########F#E#D#C#B#A#5#A#B#C#D#E#F########
######F#E#D#C#B#A#5#4#5#A#B#C#D#E#F######
####F#E#D#C#B#A#5#4#3#4#5#A#B#C#D#E#F####
##F#E#D#C#B#A#5#4#3#2#3#4#5#A#B#C#D#E#F##
F#E#D#C#B#A#5#4#3#2#1#2#3#4#5#A#B#C#D#E#F
##F#E#D#C#B#A#5#4#3#2#3#4#5#A#B#C#D#E#F##
####F#E#D#C#B#A#5#4#3#4#5#A#B#C#D#E#F####
######F#E#D#C#B#A#5#4#5#A#B#C#D#E#F######
########F#E#D#C#B#A#5#A#B#C#D#E#F########
##########F#E#D#C#B#A#B#C#D#E#F##########
############F#E#D#C#B#C#D#E#F############
##############F#E#D#C#D#E#F##############
################F#E#D#E#F################
##################F#E#F##################
####################F####################

```

Input: \\$s\\$ = `@+-|-o-|-O`, \\$c\\$ = `:`
Output:

```
::::::::::::::::::O::::::::::::::::::
::::::::::::::::O:-:O::::::::::::::::
::::::::::::::O:-:|:-:O::::::::::::::
::::::::::::O:-:|:-:|:-:O::::::::::::
::::::::::O:-:|:-:o:-:|:-:O::::::::::
::::::::O:-:|:-:o:-:o:-:|:-:O::::::::
::::::O:-:|:-:o:-:|:-:o:-:|:-:O::::::
::::O:-:|:-:o:-:|:-:|:-:o:-:|:-:O::::
::O:-:|:-:o:-:|:-:+:-:|:-:o:-:|:-:O::
O:-:|:-:o:-:|:-:+:@:+:-:|:-:o:-:|:-:O
::O:-:|:-:o:-:|:-:+:-:|:-:o:-:|:-:O::
::::O:-:|:-:o:-:|:-:|:-:o:-:|:-:O::::
::::::O:-:|:-:o:-:|:-:o:-:|:-:O::::::
::::::::O:-:|:-:o:-:o:-:|:-:O::::::::
::::::::::O:-:|:-:o:-:|:-:O::::::::::
::::::::::::O:-:|:-:|:-:O::::::::::::
::::::::::::::O:-:|:-:O::::::::::::::
::::::::::::::::O:-:O::::::::::::::::
::::::::::::::::::O::::::::::::::::::

```

Input: \\$s\\$ = `AB`, \\$c\\$ = `c`
Output:

```
ccBcc
BcAcB
ccBcc

```

Input: \\$s\\$ = `~`, \\$c\\$ = `X`
Output:

```
~

```

Input: \\$s\\$ = `/\^/\`, \\$c\\$ = `X`
Output:

```
XXXXXXXX\XXXXXXXX
XXXXXX\X/X\XXXXXX
XXXX\X/X^X/X\XXXX
XX\X/X^X\X^X/X\XX
\X/X^X\X/X\X^X/X\
XX\X/X^X\X^X/X\XX
XXXX\X/X^X/X\XXXX
XXXXXX\X/X\XXXXXX
XXXXXXXX\XXXXXXXX

```

# Answer
# Canvas, 8 bytes

```
Ｒ±［］／┼┼＊

```

Try it here!

7 bytes but mirrors a bunch of chars.
> 3 votes

# Answer
# , ~~118~~ ~~95~~ 92 bytes

```
function(a,d,n=length(a),I=c(n:1,1:n)[-n])for(i in I-1)write(c(a,d)[pmin(I+i,n+1)],1,n*2,,d)

```

Try it online!

Thanks to:

* Giuseppe for fixing an error and a golf
* Aaron Hayman for 22 bytes worth of golf
> 6 votes

# Answer
# , ~~59~~ 56 bytes

```
,{~[:((0-2*#)}.\[:,0,:"0({:>:t)*t=:]+/<:)[:(|.@}.,])#\@]

```

Try it online!

Too long solution for  ... (entirely my fault)
> 5 votes

# Answer
# , an ugly 118 bytes version

By letting the input be a vector of single characters, and outputting a matrix instead of printing nice ascii art.

```
function(s,C,l=length(s),L=4*l-3,k=2*l-1,y=abs(rep(1:k,L)-l)+abs(rep(1:L,e=k)-k)/2+1)matrix(ifelse(y%%1|y>l,C,s[y]),k)

```

Try it online!

# , 161 157 bytes

saved 4 bytes by using ifelse instead of conditionally modifying `y`

```
function(S,C,l=nchar(S),L=4*l-3,k=2*l-1,y=abs(rep(1:L,k)-k)/2+abs(rep(1:k,e=L)-l)+1)cat(rbind(matrix(ifelse(y%%1|y>l,C,el(strsplit(S,''))[y]),L),'
'),sep='')

```

Try it online!

## ungolfed and commented

```
function(S,C){
    s=el(strsplit(S,''))
    l=nchar(S)
    L=4*l-3
    k=2*l-1
    y=abs(rep(1:L,k)-k)/2+abs(rep(1:k,e=L)-l)+1 # distance from centre
    y[!!y%%1]=l+1  # set non integers to one more than length of string
    y[y>l]=l+1     # set number beyond length of string to one more than length of string
    M = rbind(matrix(c(s,C)[y],L),'\n') # build matrix and add line returns
    cat(M,sep='') # print the matrix as a string
}

```

hmmm, seems like the longest answer so far!
> 5 votes

# Answer
# Python 2, ~~97~~ ~~96~~ ~~90~~ 84 bytes

```
def f(s,c):r=range(len(s));return[c.join(c*i+s[:i:-1]+s[i:]+c*i)for i in r[:0:-1]+r]

```

Try it online!
> 4 votes

# Answer
# 05AB1E, ~~15~~ 11 bytes

```
.sûsζøsýí€û

```

Try it online! or as a Test Suite

**Explanation**

```
.s            # push suffixes of input
  û           # palendromize this list
   sζ         # transpose using the second input as filler
     ø        # transpose back
      sý      # merge each on the second input
        í     # reverse each row
         €û   # palendromize each row

```
> 4 votes

# Answer
# Ruby, ~~95~~ ~~84~~ 75 bytes

```
->a,c{(1...2*z=a.size).map{|i|s=a[j=(z-i).abs,z]*c+c*2*j;s.reverse.chop+s}}

```

Try it online!

Takes input string as an array of chars. Returns an array of strings.
> 4 votes

# Answer
# K (ngn/k), 39 bytes

```
{1_',/'y,''2{+x,1_|x}/(#x)':1_,/+y,'|x}

```

Try it online!

`{` `}` function with arguments `x` (the string *s*) and `y` (the character *c*)

`|x` reverse `x`

`y,'` prepend `y` to each

`+` transpose

`,/` concat

`1_` drop first char

at this point we have a string of length(`x`) instances of `y` followed by the characters from `x`

`#x` length of `x`

`(#x)':` sliding window of that many consecutive chars

`2{` `}/` do twice

`+x,1_|x` join `x` with the reversed `x` without its first element, and transpose

`y,''` prepend `y` to each each

`,/'` concat each

`1_'` drop one from each
> 4 votes

# Answer
# , ~~35 34~~  33 bytes

```
,{~1j1(}:@#"1{:(<*-)1-|+/|)i:@-&#

```

Try it online!

Right to left:
`-&#` Length of \\$c\\$ minus the length of \\$s\\$
`i:` Range from negative **n** to **n**
`1-|+/|` Absolute value, outer sum with absolute value, subtract from 1
`{: (<*-)` Compare the matrix with the end of the range (the `-&#`), 0 for less than or equal, 1 otherwise. Also subtract the matrix from the end of range. Multiply together. The double subtraction saves a byte and gives something like this

```
 0  0 _1  0  0
 0 _1 _2 _1  0
_1 _2 _3 _2 _1
 0 _1 _2 _1  0
 0  0 _1  0  0

```

Negative indices start from -1 like in python. The only thing left is to insert the columns of zeroes.

`1j1( #"1` for each row, repeat each element 1 time and pad with one 0
`}:@`  then drop the last one (zero)
`,{~`concat \\$c\\$ and \\$s\\$ and index into that

Many thanks to Galen Ivanov for the algorithm.
> 4 votes

# Answer
# Japt, 15 bytes

Returns an array of lines

```
Ôå+ ®¬qV êÃûV ê

```

Try it

```
Ôå+ ®¬qV êÃûV ê     :Implicit input of strings U=s & V=c
Ô                   :Reverse U
 å+                 :Prefixes
    ®               :Map
     ¬              :  Split
      qV            :  Join with V
         ê          :  Palindromise
          Ã         :End map
           ûV       :Centre pad each string with V, to the length of the longest
              ê     :Palindromise

```
> 3 votes

# Answer
# Charcoal, 15 bytes

```
ＵＢηＥθ✂θκ‖Ｏ↑←ＵＥ¹

```

Try it online! Link is to verbose version of code. Originally submitted as a comment on the now deleted sandbox post. Explanation:

```
ＵＢη

```

Set the background to the second input `c`.

```
Ｅθ✂θκ

```

Map over the first input `s` to generate all suffixes and implicitly print them on separate lines.

```
‖Ｏ↑←

```

Reflect horizontally and vertically.

```
ＵＥ¹

```

Add extra space horizontally.
> 3 votes

# Answer
# APL (Dyalog Classic), ~~32~~ 31 bytes

```
(⍉1↓¯1↓⊖⍪1↓⊢)⍣2∘↑(≢⊣),/,¨,2⍴¨⊢¨

```

Try it online!
> 3 votes

# Answer
# Wolfram Language (Mathematica), 121 bytes

```
Join[q=Table[(v=Table[#2,2(l-k)])<>Riffle[Join[(h=Reverse)[n=(g=Take)[#,-k]],g[n,-k+1]],#2]<>v,{k,l=Length@#}],Rest@h@q]&

```

Try it online!
> 2 votes

# Answer
# Japt, 16 bytes

*Note: I'll golf it :)*

```
Ôå+ ®¬qVÃùV mê ê

```

Try it online!
> 2 votes

# Answer
# PowerShell, 120 bytes

```
param($s,$c)($s,(($l=$s.length-1)..0+1..$l|%{($x=$c*(2*$_))+($s[($_,($l..$_+($_+1)..$l))[$_-ne$l]]-join$c)+$x}))[$l-gt0]

```

Try it online!

Some days, having index ranges instead of slices really hurts. Today is one of those days. Due to conjoined ranges messing up when dealing with single elements (e.g. returning 0..0+1..0), special-casing is used to avoid it altogether (at the cost of many bytes).
> 2 votes

# Answer
# Japt, 15 bytes

```
Ôå+ ê ®ê ¬qV
ûV

```

Try it
> 2 votes

# Answer
# PowerShell, ~~82~~ 83 bytes

*+2 bytes thanks Veskah: the single character case bug fixed*

*-1 byte: The rule `Input-string may also be a list of characters` used*

```
$c,$s=$args
($s|%{(-join$s|% s*g $i)+$c*$i++})[($r=$i..0+1..$i)]|%{"$_"[$r]-join$c}

```

Try it online!

Less golfed:

```
$c,$s=$args
$southEast = $s|%{
    (-join$s|% substring $i) + $c*$i++
}
$range=$i..0+1..$i
$southEast[$range]|%{
    "$_"[$range]-join$c
}

```
> 2 votes

# Answer
# Jelly, 11 bytes

```
jÐƤṚzṚŒḄZŒḄ

```

Try it online!

Left argument: \\$s\\$.
Right argument: \\$c\\$ (as a single character, not as a string).
Output: List of Jelly strings (appears as a list of lists of 1-char Python strings, replace `ŒṘ` with `Y` to see the `\n`-joined output).
> 2 votes

# Answer
# Pip, ~~24~~ 20 bytes

```
QPRV:_JbMa@>RV,#aZDb

```

Use the `-l` flag to get human-readable output. Try it online!

### Explanation

```
QPRV:_JbMa@>RV,#aZDb
                      a,b are cmdline args (implicit)
                a     1st cmdline arg (the string)
               #      Length
              ,       Range
            RV        Reverse
         a@>          Take slices of a starting at those indices
                 ZDb  Zip the list of slices together, filling out missing values in
                      the matrix with b (the character)
        M             To each row, map this function:
     _Jb               Join on b
  RV:                 Reverse (making top row the bottom and vice versa)
QP                    Quad-palindromize: reflect downward and rightward, with overlap

```

For example, with inputs of `abcd` and `.`:

```
RV,#a
 [3 2 1 0]
a@>
 ["d" "cd" "bcd" "abcd"]
ZDb
 [['d 'c 'b 'a] ['. 'd 'c 'b] ['. '. 'd 'c] ['. '. '. 'd]]
_JbM
 ["d.c.b.a" "..d.c.b" "....d.c" "......d"]
RV:
 ["......d" "....d.c" "..d.c.b" "d.c.b.a"]
QP
 ["......d......" "....d.c.d...." "..d.c.b.c.d.." "d.c.b.a.b.c.d" "..d.c.b.c.d.." "....d.c.d...." "......d......"]

```
> 2 votes

# Answer
# Perl 6, 79 bytes

```
->\c{{map {join c,g $_ X||c},g .[^*X+(^$_,)]}o*.comb}
my&g={.[$_-1...0...$_-1]}

```

Try it online!

Anonymous codeblock that takes input curried (like `f(char)(string)`) and returns a list of lines. I think a different approach would be shorter.

### Explanation:

```
my&g={.[$_-1...0...$_-1]}  # Helper function to palindromise a list
->\c{                                                }  # Code block that takes a char
     {                                       }o*.comb   # And returns a function
                                .[^*X+(^$_,)]  # Get all prefixes with end padding
                                               # e.g. "str" => [["r",Nil,Nil]
                                                                ["t","r",Nil]
                                                                ["s","t","r"]]
                              g   # Palindromise the lsit
       map {                },    # Map each element to
                     $_ X||c      # Replace all Nils with the character
                   g              # Palindromise it
            join c,               # And join by the character

```
> 2 votes

# Answer
# Attache, 57 bytes

```
${q:=#x-1Bounce!Bounce@Join&y@PadLeft&y&#x=>x[q::(q::0)]}

```

Try it online! Output is a list of lines.

## Explanation

```
?? parameters: x, y
${
    ?? q is length of x - 1
    q:=#x-1
    ?? Reflect, collapsing middle:
    Bounce!
        ?? Function:
            ?? Reflect,
            Bounce@
            ?? Joined by y,
            Join&y@
            ?? padded to the length of x with y
            PadLeft&y&#x
        ?? Mapped over
        =>
            ?? The elements of x at
            x[
                ?? decreasing range from q to
                q::(
                    ?? each element in the range from q to 0
                    q::0
                )
            ]
}

```
> 2 votes

# Answer
# Perl 5 with `-lF`, `-M5.010`, 71 bytes

```
$"=<>;$A=abs,$_="@F[$A..$#F]".$"x($A*2),/./,say reverse.$' for-$#F..$#F

```

Try it online!
> 1 votes

# Answer
# TSQL query, 191 bytes

In MS-SQL Server Management Studio press Ctrl-T before running this query, this will change the output to text.

This script is building up the output from left to right in one long "string", calculating the value to put in each position. The output is limited to 4096 characters.

**Golfed:**

```
SELECT
string_agg(iif(h>k/2,@y,substring(@,h+1,1))+iif(-~n%k=0,'
',@y),'')FROM(SELECT
abs(k/2-n%k)+abs(k/2-n/k)h,*FROM(SELECT
number n,len(@)*2-1k,*FROM spt_values)c)d
WHERE n<k*k and'P'=type

```

**Ungolfed:**

```
USE master
DECLARE
@y char='.',
@ varchar(20) = 'abcd'

SELECT
  string_agg(iif(h>k/2,@y,substring(@,h+1,1))+iif(-~n%k=0,'
',@y),'')
FROM
(
  SELECT
    abs(k/2-n%k)+abs(k/2-n/k)h,*
  FROM
  (
    SELECT
      number n,
      len(@)*2-1k,*
    FROM spt_values
  )c
)d
WHERE n<k*k and'P'=type

```

I had to make some changes to format the output in the online version.

**Try it online**
> 1 votes

# Answer
# C# (Visual C# Interactive Compiler), 249 bytes

```
s=>c=>{var r=s.Select((x,_)=>{int k=s.Length;var m=s.Substring(_,k-_).Aggregate("",(a,b)=>a+c+b);return new string(m.Skip(2).Reverse().Concat(m.Skip(1)).ToArray()).PadLeft(2*k-3+m.Length,c).PadRight(4*k-3,c);});return r.Skip(1).Reverse().Concat(r);}

```

Try it online!

This must be improvable...
> 1 votes

# Answer
# JavaScript (Node.js), 143 bytes

```
(s,c)=>{q=Math.abs;m=(l=s.length*4-3)-1;for(i=j=0;j<l/2;(i=(++i)%l)?0:++j){p=s[q(i-m/2)/2+q(j-m/4)];process.stdout.write((i?"":"\n")+(p?
p:c))}}

```

Try it online!

A bit more thinkering would lead to calculating in terms of a one-dimensional array, and less bytes.
> 1 votes

# Answer
# Kotlin, 250 bytes

Note: Kotlin tio currently fails to return a new class so this code gets an null pointer exception. This also occurs for codes I previously posted that worked at that time. I assume it will eventually get fixed, but couldn't find a support contact to report the issue to. It can also be run here.

```
{s:String,c:Char->val h=s.length*2-1
val w=h*2-1
val m=Array(h){Array(w){c}}
for(i in s.indices)for(r in 0..h-1){val o=(i-Math.abs(h/2-r))*2
if(o>=0){m[r][w/2+o]=s[i].toChar()
m[r][w/2-o]=s[i].toChar()}}
m.map{it.joinToString("")}.joinToString("\n")}

```

Try it online!
> 1 votes

# Answer
# JavaScript (Node.js), 101 bytes

```
s=>c=>[l=s.length-1,...Array(l*2)].map((x,i,a,m=Math.abs)=>a.map((y,j)=>s[m(l-i)+m(l-j)]||c).join(c))

```

Try it online!
> 1 votes

# Answer
# Java (JDK), ~~213~~ ~~199~~ 198 bytes

```
a->b->{int i=0,l=a.length()-1;String s=a,r[]=new String[l-~l],p;for(;i<=l;s=s.substring(1))r[l+i]=r[l-i]=new StringBuffer(p=b.join(b,s.split(""))+b.repeat(2*i++)).reverse()+p.substring(1);return r;}

```

Try it online!

`-14 bytes` thanks to @KevinCruijssen
`-1 byte` thanks to @ceilingcat

### Ungolfed

```
a->
    b-> {
        int i = 0, l = a.length() - 1;
        String s = a, r[]=new String[a.length()*2-1],p;
        for (; i<=l; s=s.substring(1))
            r[l+i]
              = r[l-i++]
              =   new StringBuffer(
                                   p =   String.join(b,s.split(""))
                                       + b.repeat(2*i)
                                  ).reverse()
                + p.substring(1);
        return r;
    }

```
> 1 votes

# Answer
# Gaia, 19 bytes

```
:ṫl¤┅v;@&Z¦<¦v¦ṫ¦ṫṣ

```

Try it online!

Explanation to follow.
> 1 votes

# Answer
# Wolfram Language (Mathematica), ~~68~~ ~~67~~ ~~65~~ 64 bytes

```
cTable[c&@@#[[1+{,y}~Norm~1]],{y,l=1-Tr[1^#],-l},{,l,-l,.5}]&

```

Try it online!

Input `[c][s]`, where `s` is a list of characters, and returns a matrix of characters.

```
Table[                      ,{y,l=1-Tr[1^#],-l},{,l,-l,.5}] table from 1-len to len-1; resolution 1 (y) and .5 (x)
          #[[1+{,y}~Norm~1]]                                  get the (1+|x|+|y|)th character
      c&@@                                                    if indexing failed, use filler character instead

```

`list[[index]]` is equivalent to `Part[list, index]`. If the index is not valid, i.e. it's not an integer or is out of bounds, that expression remains unevaluated.

Then, `c&@@...` replaces the head of the expression it's acting on. This doesn't affect atomic expressions, such as characters (`String`s), but it does affect unevaluated `Part` expressions.
> 1 votes

# Answer
# Vyxal `j`, 14 bytes

```
Ṙ¦₅↳ømƛð⁰V⁰jøm

```

Try it Online!

```
Ṙ              # Reverse
 ¦             # Prefixes
  ₅↳           # Pad right to correct width
    øm         # Mirror
      ƛ        # Map...
       ð⁰V     # Replace spaces with other char
          ⁰j   # Join by other char
            øm # Mirror
               # (j flag) join by newlines.

```
> 1 votes

# Answer
# Pip, 28 bytes

```
PZRV(PZRV(a@>_Jb).bX2*_M,#a)

```

Try it online!

There's probably a shorter way with a single palindromize use, but I was unable to find it.

## Explanation

```
PZRV(PZRV(a@>_Jb).bX2*_M,#a) a → input
                        ,#a  range from 0  to length of a
                       M     map the lambda on the left to each item in range
                             _ → argument(each element of list)
          a@>_               Slice of input after index _
              Jb             Join characters with second input
                 bX2*_       repeat second input _ times
                .            concatenate the two
       RV                    reverse it: 'b..' → '..b'
     PZ                      palindromize the string '..b' → '..b..'
  RV(                      ) reverse the whole mapped list to get top part of the mat
PZ                           palindromize for full mat

```
> 0 votes

---
Tags: code-golf, string, ascii-art
---


title: Dynamically Create Boxes

text:
# Question
Title: Dynamically Create Boxes
**The Challenge:**

Draw a rectangle of ASCII boxes: \[\]

**The Rules:**

Takes a width and a height input

You can assume both of these are numbers

Must produce a string with newline characters, \n

**Examples:**

2, 2:

```
[][]
[][]

```

2, 3:

```
[][]
[][]
[][]

```

Fewest Bytes wins.

# Answer
# SOGL, 5 bytes

```
Ƨ[]*∙

```

Simple:

```
Ƨ[]    push "[]"
   *   multiply horizontally (repeating width times)
    ∙  get an array with input (height) items of that
       implicitly output the array joined with newlines

```
> 6 votes

# Answer
# Mathematica, 26 bytes

```
Grid@Table["[]",{#2},{#}]&

```
> 4 votes

# Answer
# MATL, 7 bytes

```
v&DiiX"

```

Try it online!

### Explanation

```
v    % Concatenate the (non-existing) stack contents: gives []
&D   % String representation: gives '[]'
ii   % Take two inputs
X"   % Repeat those numbers of times vertically and horizontally. Implicit display

```
> 4 votes

# Answer
# Pyth - ~~7~~ 5 bytes

-2 bytes by a clever trick thanks to insert\_name\_here

```
VE*`Y

```

Try it here

Explanation:

```
VE*`Y
V      # Loop
 E     # <input> number of times
   `Y  # String representation of empty list (used to be "[]", but insert_name_here pointed out this shorter alternative)
  *    # repeat string implicit input number of times
       # implicit print

```
> 4 votes

# Answer
# C, ~~47~~ 46 bytes

```
f(w,h){for(h*=w;h--;)printf(h%w?"[]":"[]\n");}

```

or

```
f(w,h){for(h*=w;h--;)printf("[]%c",h%w?0:10);}

```

My first code golf attempt, did I miss anything obvious?
> 4 votes

# Answer
# 05AB1E, 6 bytes

```
F„[]×,

```

Try it online!

**Explanation**

Input takes as `height, width`

```
F         # height times do
 „[]      # push "[]"
    ×     # repeat width times
     ,    # print with newline

```
> 3 votes

# Answer
# ;#+, 197 bytes

```
>;;;;;;~++++++++:>~;;;;:>~*(-:~<~+-::>-:::<~<-+++++++++~:::<~+-:::>-::*)-::<-::::>-::(;)::>-::*(-:~<~+-::>-:::<~<-+++++++++~:::<~+-:::>-::*)-:<~<;;;;;-+>-:<-:-(-:::~<-:::(~<#<-;;-#~;)-:<#-::<;>-:-)

```

Try it online! Requires a zero byte after each input number.

I kinda don't know how this works. What I can tell you is that this part of the code:

```
 *(-:~<~+-::>-:::<~<-+++++++++~:::<~+-:::>-::*)-::<-::::>-::(;)::>-::*(-:~<~+-::>-:::<~<-+++++++++~:::<~+-:::>-::*)

```

is parsing the input numbers.
> 3 votes

# Answer
# brainfuck, 145 bytes

```
+++++++++[>++++++++++<-]>+[>+>+<<-]>>++>,>+++++++++[<----->-]<--->>>,>+++++++++[<----->-]<--->++++++++++<[<<<[>+>+<<-]>[<<<.>.>>-]>[<<+>>-]>>.<-]

```

Try it online!

My first ever code golf! Yay!

The input is in ascii + 48, so in order to do 50, 50 you must input b, b (the ascii letters for 98)

## Explanation

```
+++++++++[>++++++++++<-]>+ Get the opening square bracket into first position
[>+>+<<-] Get it into the second and third position
>>++ Get the third position to be the closing bracket
>
,>+++++++++[<----->-]<--- Get first number into fourth cell
>>>
,>+++++++++[<----->-]<--- Get second number into seventh cell
>++++++++++ get newline into 8th position
<

[ Start our height loop
<<<[>+>+<<-] Get the width into the fifth and sixth positions
>[ Start our width loop at the fifth position
<<<.>. Print the second and third positions
>>-] Decrement the fifth position
>
[<<+>>-] copy the sixth position into the fourth position
>>. print newline
<-]

```
> 3 votes

# Answer
# , 12 bytes

```
'[]'$~],+:@[

```

Try it online!

## Explanation

```
'[]'$~],+:@[   input: y, x
        +:@[   double y
      ],       pair with x
               this gives (x, 2y)
    $~         shape the left argument into the right argument's shape
'[]'           2-length character string

```

This gives us an `x` by `2y` string of repeating `[]` characters.
> 2 votes

# Answer
# Python 2.7, 32 bytes

Full program:

```
n,m=input()
exec"print'[]'*n;"*m

```

Try it online!
> 2 votes

# Answer
# Jelly, 7 bytes

```
ẋ⁾[]ẋ$Y

```

A dyadic link returning a list of characters (or a full program printing the result).

**Try it online!**

### How?

```
ẋ⁾[]ẋ$Y - Main link: number w, number h          e.g. 2, 3
ẋ       - repeat w h times                            [2,2,2]
     $  - last two links as a monad:
 ⁾[]    -   literal ['[',']'],                        "[]"
    ẋ   -   repeat list (vectorises)                  ["[][]","[][]","[][]"]
      Y - join with newlines                          "[][]\n[][]\n[][]"
        - if a full program, implicit print

```
> 2 votes

# Answer
# PowerShell, 25 Bytes

```
param($w,$h),("[]"*$w)*$h

```

-3 thanks to Mathias!
> 2 votes

# Answer
# Japt, ~~13~~ 12+1= ~~14~~ 13 bytes

+1 for the `-R` flag.

```
"[]"pN× òU*2

```

Try it online

* 1 byte saved thanks to obarakon.
> 2 votes

# Answer
# Retina, 32 bytes

```
.+
$*
1(?=1*(¶1+))|.
$1
G`1
1
[]

```

Try it online! Takes height and width input on separate lines.
> 2 votes

# Answer
# Charcoal, ~~8~~ 7 bytes

```
ＥＮ×[]Ｉη

```

Try it online! Link is to verbose version of code. Takes input in the order height, width. Charcoal's drawing primitives aren't suited to this, so this just takes the easy way out and repeats the `[]` string appropriately. Explanation:

```
 Ｎ      First input as a number
Ｅ       Map over implcit range
      η Second input
     Ｉ  Cast to number
   []   Literal string
  ×     Repeat
        Implicitly print on separate lines

```
> 2 votes

# Answer
# Python 3, 26 bytes

```
lambda n,m:('[]'*n+'\n')*m

```

Try it online!
> 2 votes

# Answer
# , 7 bytes

```
Ài[]<esc>ÀÄ

```

where `<esc>` is `0x1b`.

Try it online!

### Explanation

```
Ài[]<esc>                    " arg1 times insert []
         ÀÄ                  " arg2 times duplicate this line

```
> 2 votes

# Answer
# Ohm, 9 bytes

```
M"[]"┘ÄJ,

```

Try it online!

### Explanation

```
M"[]"┘ÄJ,
M         //Executes code input1 times
 "[]"     //Pushes []
     ┘Ä   //Duplicates [] input2 times
       J  //Joins the stack
        , //Prints with a trailing newline

```
> 2 votes

# Answer
# APL (Dyalog), 11 bytes

```
'[]'⍴⍨⊢,2×⊣

```

Try it online!

`'[]'` the string

`⍴⍨` cyclically repeated to fill the shape

right argument (rows)

`,` and

twice

the left argument (columns)
> 2 votes

# Answer
# Bash, 55 bytes

```
seq $(($1*$2))|sed s/.*/[]/|tr -d "
"|fold -w $(($1*2))

```

Try it online! Uses the TIO flavor of bash, since I run windows.
> 1 votes

# Answer
# Japt, 7 bytes

6 bytes of code, +1 for the `-R` flag.

```
VÆç"[]

```

Doesn't work in the latest version due to a bug with `ç`, but it does work in commit `f619c52`. Test it online!

### Explanation

```
VÆ   ç"[]
VoX{Uç"[]"}  // Ungolfed
             // Implicit: U, V = input integers
VoX{      }  // Create the range [0...V) and replace each item X with
    Uç"[]"   //   U copies of the string "[]".
-R           // Join the result with newlines.
             // Implicit: output result of last expression

```
> 1 votes

# Answer
# , 70 bytes

```
p=paste
function(w,h)p(rep(p(rep('[]',w),collapse=''),h),collapse='
')

```

Try it online!

Returns an anonymous function that constructs and returns the string.

## 45 bytes, non-conforming

```
function(w,h)write(matrix('[]',w,h),'',w,,'')

```

An anonymous function that prints out the string in the desired format.

Try this online
> 1 votes

# Answer
# Go, 74 bytes

```
import."strings"
func(x,y int)string{return Repeat(Repeat("[]",x)+"\n",y)}

```

Try it online!
> 1 votes

# Answer
## QBIC, 14 bytes

```
[:|?[:|?@[]`';

```

Explanation:

```
[:|     FOR a = 1 to (read input from cmd line)
?       PRINT a newlne
[:|     FOR c = 1 to (read input from cmd line)
?@[]`   PRINT A$ (containing the box)
';         and inject a semicolon in the compiled QBasic code to suppress newlines

```

This takes its arguments in the order of #rows, #cols. Output starts with a newline.
> 1 votes

# Answer
# JavaScript (ES6), ~~43~~ 36 bytes

From the comments, a trailing newline is now permitted.

```
w=>h=>("[]".repeat(w)+`
`).repeat(h)

```

---

## Try it

```
f=
w=>h=>("[]".repeat(w)+`
`).repeat(h)
oninput=_=>o.innerText=f(+i.value)(+j.value);o.innerText=f(i.value=2)(j.value=2)
```

```
*{font-family:sans-serif;}
input{margin:0 5px 0 0;width:50px;}
```

```
<label for=i>w: </label><input id=i type=number><label for=j>h: </label><input id=j type=number><pre id=o>
```
> 1 votes

# Answer
## Pyke, 8 bytes

```
}A;**"[]

```

Try it here!

Also 8 bytes:

```
 F2K*"[]

```

Try it here!
> 1 votes

# Answer
## C#, 78 bytes

```
(w,h)=>"".PadLeft(h).Replace(" ","".PadLeft(w).Replace(" ","[]")+'\n').Trim();

```

Run in C# Pad

This is shorter than with for-loops and I'm not aware of any function in C# which can repeat with less code.
> 1 votes

# Answer
## CJam, 10 bytes

```
l~"[]"*N+*

```
> 1 votes

# Answer
# , 11 bytes

```
,./@$'[]'"0

```

Try it online!
> 1 votes

# Answer
# Canvas, 4 bytes

```
[]×＊

```

Try it here!
> 1 votes

# Answer
# Vyxal `j`, ~~6~~ 5 bytes

```
ƛk[⁰*

```

Try it Online!

Takes height then width.

-1 thanks to lyxal.

```
ƛ      # map 0...(height) to...
 k[    # `[]`
    *  # repeated...
   ⁰   # (width)
    *  # times
       # (j flag) join by newlines

```
> 1 votes

# Answer
# Tcl, 50 bytes

```
proc B w\ h {time {puts [string repe {[]} $w]} $h}

```

Try it online!
> 0 votes

# Answer
# R, 49 bytes

```
s=scan;cat(rep(c(rep("[]",s()),"\n"),s()),sep="")

```

**Ungolfed :**

```
s=scan # Creates an alias for the scan function

cat( # Prints to STDOUT
    rep( # The repetion of the following string :
        c(rep("[]",s()),"\n"), # "[]" repeated the number of times inputed by the user, followed by a linebreak
    s()), # This number of time (again, user inputed)
sep="") # with no separator

```
> 0 votes

# Answer
# Perl 5, 19 bytes

```
say for('[]'x<>)x<>

```

Try it online!
> 0 votes

# Answer
# Zsh, 31 bytes

```
repeat $1 S+=[]
repeat $2 <<<$S

```

Try it online!
> 0 votes

---
Tags: code-golf, string, ascii-art
---


title: When I grow up I want to be ASCII

text:
# Question
Title: When I grow up I want to be ASCII
# Task

Your task is to take a character in:

`AÁÀÃÂBCÇDEÉÊFGHIÍJKLMNOÕÓÔPQRSTUÚVWXYZaáàãâbcçdeéêfghiíjklmnoõóôpqrstuúvwxyz`

and turn it into a characters in:

`AAAAABCCDEEEFGHIIJKLMNOOOOPQRSTUUVWXYZaaaaabccdeeefghiijklmnoooopqrstuuvwxyz`

by the obvious operation: dropping the accents in the letters.

# Input

A character in any sensible format, including but not limited to:

* A string with only one character;
* A unicode codepoint.

# Output

The transformed char in any sensible format, which includes:

* A string with only one char;
* A unicode codepoint.

# Test cases

```
'A' -> 'A'
'Á' -> 'A'
'À' -> 'A'
'Ã' -> 'A'
'Â' -> 'A'
'B' -> 'B'
'C' -> 'C'
'Ç' -> 'C'
'D' -> 'D'
'E' -> 'E'
'É' -> 'E'
'Ê' -> 'E'
'F' -> 'F'
'G' -> 'G'
'H' -> 'H'
'I' -> 'I'
'Í' -> 'I'
'J' -> 'J'
'K' -> 'K'
'L' -> 'L'
'M' -> 'M'
'N' -> 'N'
'O' -> 'O'
'Õ' -> 'O'
'Ó' -> 'O'
'Ô' -> 'O'
'P' -> 'P'
'Q' -> 'Q'
'R' -> 'R'
'S' -> 'S'
'T' -> 'T'
'U' -> 'U'
'Ú' -> 'U'
'V' -> 'V'
'W' -> 'W'
'X' -> 'X'
'Y' -> 'Y'
'Z' -> 'Z'
'a' -> 'a'
'á' -> 'a'
'à' -> 'a'
'ã' -> 'a'
'â' -> 'a'
'b' -> 'b'
'c' -> 'c'
'ç' -> 'c'
'd' -> 'd'
'e' -> 'e'
'é' -> 'e'
'ê' -> 'e'
'f' -> 'f'
'g' -> 'g'
'h' -> 'h'
'i' -> 'i'
'í' -> 'i'
'j' -> 'j'
'k' -> 'k'
'l' -> 'l'
'm' -> 'm'
'n' -> 'n'
'o' -> 'o'
'õ' -> 'o'
'ó' -> 'o'
'ô' -> 'o'
'p' -> 'p'
'q' -> 'q'
'r' -> 'r'
's' -> 's'
't' -> 't'
'u' -> 'u'
'ú' -> 'u'
'v' -> 'v'
'w' -> 'w'
'x' -> 'x'
'y' -> 'y'
'z' -> 'z'

```

You can check here for a Python reference implementation without regexes.

---

This is so shortest submission in bytes, wins! If you liked this challenge, consider upvoting it... And happy golfing!

# Answer
> 27 votes
# JavaScript (Node.js), 39 bytes

A port of my CP-1610 answer.

I/O format: a Unicode code point.

```
n=>n>>7?Buffer("ACEIOOU")[n/4&7]^n&32:n

```

Try it online!

---

# JavaScript (Node.js), 44 bytes

I/O format: a string with only one character.

```
c=>'oeaUICuic?OEA'[Buffer(c)[1]*13%59%13]||c

```

Try it online!

### How?

When passed into `Buffer()`, the accented letters used in the challenge are turned into two bytes \\$(b\_0,b\_1)\\$, corresponding to their UTF-8 encoding. The non-accented letters are turned into a single byte \\$b\_0\\$ corresponding to their regular ASCII code (or 1-byte UTF-8 encoding).

*Examples:*

```
Buffer('À') // --> <Buffer c3 80>
Buffer('B') // --> <Buffer 42>

```

Try it online!

We use the following formula to convert the 2nd byte of accented letters to an index \\$n\\$ into a 13-character lookup string of non-accented letters:

$$n=((b\_1\times13)\bmod 59)\bmod 13$$

This results in `NaN` for non-accented letters, which are simply left unchanged.

```
  c  |   UTF-8    | 2nd byte | * 13 | mod 59 | mod 13 | output
-----+------------+----------+------+--------+--------+--------
 'À' | 0xC3, 0x80 |    128   | 1664 |   12   |   12   |  'A'
 'Á' | 0xC3, 0x81 |    129   | 1677 |   25   |   12   |  'A'
 'Â' | 0xC3, 0x82 |    130   | 1690 |   38   |   12   |  'A'
 'Ã' | 0xC3, 0x83 |    131   | 1703 |   51   |   12   |  'A'
 'Ç' | 0xC3, 0x87 |    135   | 1755 |   44   |    5   |  'C'
 'É' | 0xC3, 0x89 |    137   | 1781 |   11   |   11   |  'E'
 'Ê' | 0xC3, 0x8A |    138   | 1794 |   24   |   11   |  'E'
 'Í' | 0xC3, 0x8D |    141   | 1833 |    4   |    4   |  'I'
 'Ó' | 0xC3, 0x93 |    147   | 1911 |   23   |   10   |  'O'
 'Ô' | 0xC3, 0x94 |    148   | 1924 |   36   |   10   |  'O'
 'Õ' | 0xC3, 0x95 |    149   | 1937 |   49   |   10   |  'O'
 'Ú' | 0xC3, 0x9A |    154   | 2002 |   55   |    3   |  'U'
 'à' | 0xC3, 0xA0 |    160   | 2080 |   15   |    2   |  'a'
 'á' | 0xC3, 0xA1 |    161   | 2093 |   28   |    2   |  'a'
 'â' | 0xC3, 0xA2 |    162   | 2106 |   41   |    2   |  'a'
 'ã' | 0xC3, 0xA3 |    163   | 2119 |   54   |    2   |  'a'
 'ç' | 0xC3, 0xA7 |    167   | 2171 |   47   |    8   |  'c'
 'é' | 0xC3, 0xA9 |    169   | 2197 |   14   |    1   |  'e'
 'ê' | 0xC3, 0xAA |    170   | 2210 |   27   |    1   |  'e'
 'í' | 0xC3, 0xAD |    173   | 2249 |    7   |    7   |  'i'
 'ó' | 0xC3, 0xB3 |    179   | 2327 |   26   |    0   |  'o'
 'ô' | 0xC3, 0xB4 |    180   | 2340 |   39   |    0   |  'o'
 'õ' | 0xC3, 0xB5 |    181   | 2353 |   52   |    0   |  'o'
 'ú' | 0xC3, 0xBA |    186   | 2418 |   58   |    6   |  'u'

```

# Answer
> 20 votes
# PHP, 42 39 34 bytes

```
<?=iconv('','us//TRANSLIT',$argn);

```

-3 Bytes thanks to @Neil

Try it online!

# Answer
> 11 votes
# JavaScript (Node.js), 22 bytes

```
s=>s.normalize`NFD`[0]

```

Try it online!

save 2 bytes, thanks Arnauld.

# Answer
> 11 votes
# T-SQL, ~~35~~ 33 bytes

```
SELECT v COLLATE Greek_BIN FROM t

```

Input is taken from a pre-existing table *t* with `CHAR(1)` column *v*, per our IO standards.

This code simply displays the input after converting it to a different *SQL collation*.

SQL collations define sorting rules as well as case and accent sensitivity properties for SQL text data. They can even define the valid code page, which is how this particular trick works. Code page 1253 ("Greek - ANSI") doesn't include any of the accented characters in the question, so the collation conversion maps each to its non-accented version.

I based my version on this StackOverflow answer, which uses a more standard collation with a much longer name: `SQL_Latin1_General_CP1253_CI_AI`.

**EDIT**: Saved 2 bytes by replacing `Greek_CS_AI` with `Greek_BIN`. Both use code page 1253, which is really the part that matters, not the "accent insensitive" property.

SQL supports nearly 4000 collations, run this on your SQL server to return all collations that use code page 1253, ordered by the shortest name:

```
SELECT name, bytes=len(name), description, codepage=COLLATIONPROPERTY(name, 'CodePage')
FROM fn_helpcollations()
WHERE COLLATIONPROPERTY(name, 'CodePage') = 1253
ORDER BY len(name)

```

It is possible to replace characters individually, but that is much longer (**79 Bytes**):

```
SELECT TRANSLATE(v,'ÁÀÃÂÇÉÊÍÕÓÔÚáàãâçéêíõóôú','AAAACEEIOOOUaaaaceeiooou')FROM t

```

# Answer
> 10 votes
# iconv, ~~21~~ 20 bytes

```
iconv -tus//TRANSLIT

```

Try it online! Link includes test suite. Edit: Thanks to @NahuelFouilleul for a 1 byte saving. Port of @Oxgeba's PHP answer, but I used `us` as a synonym for `ASCII` to save a further 3 bytes.

# Answer
> 10 votes
# 05AB1E (legacy), ~~24~~ ~~23~~ 22 bytes

```
žy›i•M¦>á•₂вI28&èI96&+

```

-2 bytes thanks to *@Grimmy*.

I/O as unicode codepoint.

Try it online.

**Explanation:**

```
žy›i             # If the (implicit) input-codepoint is larger than 128:
    •M¦>á•       #  Push compressed integer 3755486693
          ₂в     #  Convert it to base-26 as list: [1,5,15,21,3,9,15]
    I28&         #  Push the input-codepoint, and bitwise-AND it with 28
        è        #  Index it into the list (0-based and with wraparound)
         I96&    #  Push the input-codepoint, and bitwise-AND it with 96
             +   #  And add it to the indexed value
                 #  (after which it is output implicitly as result)
                 # (implicit else:)
                 #  (take the implicit input-codepoint as implicit output)

```

See this 05AB1E tip of mine (sections *How to compress large integers?* and *How to compress integer lists?*) to understand why `•M¦>á•` is `3755486693` and `•M¦>á•₂в` is `[1,5,15,21,3,9,15]`.

# Answer
> 9 votes
# Python 3, ~~61~~ 56 bytes

```
lambda s:s[s>'z':]or'EIOOUaaceioou_AAC'[ord(s)*17%67%17]

```

Try it online!

---

# Python 3.8 (pre-release), ~~76~~ 74 bytes

```
lambda s:(n:=name(s)*2)[21::-2].title()['SM'in n]
from unicodedata import*

```

Try it online!

**Examples**

```
s                               'À'
name(s)                         'LATIN CAPITAL LETTER A WITH GRAVE'
name(s)*2                       'LATIN CAPITAL LETTER A WITH GRAVELATIN CAPITAL LETTER A WITH GRAVE'
                                  ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
(name(s)*2)[21::-2]             'ARTE AIA IA'
(name(s)*2)[21::-2].title()     'Arte Aia Ia'
'SM' in name(s)*2 ==            False == 0
(name(s)*2)[21::-2].title()[0]  'A'

s                               'À'
name(s)                         'LATIN SMALL LETTER C WITH CEDILLA'
name(s)*2                       'LATIN SMALL LETTER C WITH CEDILLALATIN SMALL LETTER C WITH CEDILLA'
                                  ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
(name(s)*2)[21::-2]             'WCRTE LM IA'
(name(s)*2)[21::-2].title()     'Wcrte Lm Ia'
'SM' in name(s)*2               True == 1
(name(s)*2)[21::-2].title()[1]  'c'

```

---

# Python 3, 55 bytes

Basically the same as tsh's JavaScript answer.

```
lambda s:normalize('NFD',s)[0]
from unicodedata import*

```

Try it online!

# Answer
> 9 votes
# CP-1610 machine code,  ~~27 26 22~~  21 DECLEs1 ≈ 27 bytes

*As per the exception described in this meta answer, the exact score is **26.25 bytes** (210 bits)*

A routine taking a Unicode code point in **R0** and returning another code point in the same register.

```
**081**  |         MOVR    R0,     R1
**045**  |         SWAP    R1,     2
**203 009**  |         BPL     @@rtn
**065**  |         SLR     R1,     2
**3B9 007**  |         ANDI    #7,     R1
**0F9**  |         ADDR    R7,     R1
**2F9 006**  |         ADDI    #6,     R1
**3B8 020**  |         ANDI    #32,    R0
**3C8**  |         XOR@    R1,     R0
**0AF**  | @@rtn   JR      R5
**041 043 045 049** |         STRING  "ACEIOOU"
**04F 04F 055**  |

```

### How?

All the special characters we're interested in are located in the `0xC0-0xFF` Unicode range.

```
full range        relevant letters  replacement

   | 0123 4567       | 0123 4567       | 0123 4567
---+----------    ---+----------    ---+----------
C0 | ÀÁÂÃ ÄÅÆÇ    C0 | ÀÁÂÃ ---Ç    C0 | AAAA ---C
C8 | ÈÉÊË ÌÍÎÏ    C8 | -ÉÊ- -Í--    C8 | -EE- -I--
D0 | ÐÑÒÓ ÔÕÖ×    D0 | ---Ó ÔÕ--    D0 | ---O OO--
D8 | ØÙÚÛ ÜÝÞß    D8 | --Ú- ----    D8 | --U- ----
E0 | àáâã äåæç    E0 | àáâã ---ç    E0 | aaaa ---c
E8 | èéêë ìíîï    E8 | -éê- -í--    E8 | -ee- -i--
F0 | ðñòó ôõö÷    F0 | ---ó ôõ--    F0 | ---o oo--
F8 | øùúû üýþÿ    F8 | --ú- ----    F8 | --u- ----

```

As shown in the tables above, each group of \\$4\\$ accented letters is mapped to a single non-accented letter. So, given a code point \\$n\\$, we compute the index:

$$i=\left\lfloor\frac{n}{4}\right\rfloor\bmod 8$$

We pick the corresponding letter from the lookup string `"ACEIOOU"` and then apply the correct case.

### Full commented test code

```
        ROMW    10                ; use 10-bit ROM width
        ORG     $4800             ; map this program at $4800

        ;; ------------------------------------------------------------- ;;
        ;;  main code                                                    ;;
        ;; ------------------------------------------------------------- ;;
main    PROC

        SDBD                      ; set up an interrupt service routine
        MVII    #isr,   R0        ; to do some minimal STIC initialization
        MVO     R0,     $100
        SWAP    R0
        MVO     R0,     $101

        EIS                       ; enable interrupts

        SDBD                      ; R4 = pointer into the test case table
        MVII    #tc,    R4
        MVII    #$200,  R3        ; R3 = backtab pointer
        MVII    #76,    R2        ; R2 = number of test cases

@@loop  MVI@    R4,     R0        ; R0 = character code point
        CALL    conv              ; invoke our routine

        SUBI    #32,    R0        ; turn the result into an Intellivision card
        SLL     R0,     2
        SLL     R0
        MVO@    R0,     R3        ; draw it
        INCR    R3                ; increment the backtab pointer

        DECR    R2                ; next test case
        BNEQ    @@loop

        DECR    R7                ; done: loop forever

        ENDP

        ;; ------------------------------------------------------------- ;;
        ;;  test cases                                                   ;;
        ;; ------------------------------------------------------------- ;;
tc      PROC

        DECLE   65   ; A
        DECLE   193  ; Á
        DECLE   192  ; À
        DECLE   195  ; Ã
        DECLE   194  ; Â
        DECLE   66   ; B
        DECLE   67   ; C
        DECLE   199  ; Ç
        DECLE   68   ; D
        DECLE   69   ; E
        DECLE   201  ; É
        DECLE   202  ; Ê
        DECLE   70   ; F
        DECLE   71   ; G
        DECLE   72   ; H
        DECLE   73   ; I
        DECLE   205  ; Í
        DECLE   74   ; J
        DECLE   75   ; K
        DECLE   76   ; L
        DECLE   77   ; M
        DECLE   78   ; N
        DECLE   79   ; O
        DECLE   213  ; Õ
        DECLE   211  ; Ó
        DECLE   212  ; Ô
        DECLE   80   ; P
        DECLE   81   ; Q
        DECLE   82   ; R
        DECLE   83   ; S
        DECLE   84   ; T
        DECLE   85   ; U
        DECLE   218  ; Ú
        DECLE   86   ; V
        DECLE   87   ; W
        DECLE   88   ; X
        DECLE   89   ; Y
        DECLE   90   ; Z
        DECLE   97   ; a
        DECLE   225  ; á
        DECLE   224  ; à
        DECLE   227  ; ã
        DECLE   226  ; â
        DECLE   98   ; b
        DECLE   99   ; c
        DECLE   231  ; ç
        DECLE   100  ; d
        DECLE   101  ; e
        DECLE   233  ; é
        DECLE   234  ; ê
        DECLE   102  ; f
        DECLE   103  ; g
        DECLE   104  ; h
        DECLE   105  ; i
        DECLE   237  ; í
        DECLE   106  ; j
        DECLE   107  ; k
        DECLE   108  ; l
        DECLE   109  ; m
        DECLE   110  ; n
        DECLE   111  ; o
        DECLE   245  ; õ
        DECLE   243  ; ó
        DECLE   244  ; ô
        DECLE   112  ; p
        DECLE   113  ; q
        DECLE   114  ; r
        DECLE   115  ; s
        DECLE   116  ; t
        DECLE   117  ; u
        DECLE   250  ; ú
        DECLE   118  ; v
        DECLE   119  ; w
        DECLE   120  ; x
        DECLE   121  ; y
        DECLE   122  ; z

        ENDP

        ;; ------------------------------------------------------------- ;;
        ;;  ISR                                                          ;;
        ;; ------------------------------------------------------------- ;;
isr     PROC

        MVO     R0,     $0020     ; enable display

        CLRR    R0
        MVO     R0,     $0030     ; no horizontal delay
        MVO     R0,     $0031     ; no vertical delay
        MVO     R0,     $0032     ; no border extension
        MVII    #$D,    R0
        MVO     R0,     $0028     ; light-blue background
        MVO     R0,     $002C     ; light-blue border

        JR      R5                ; return from ISR

        ENDP

        ;; ------------------------------------------------------------- ;;
        ;;  our routine                                                  ;;
        ;; ------------------------------------------------------------- ;;
conv    PROC

        MOVR    R0,     R1        ; copy R0 to R1
        SWAP    R1,     2         ; copy the lower byte of R1 to its upper byte,
                                  ; resulting in a negative word for an accented letter
        BPL     @@rtn             ; return right away if it's a regular ASCII character

        SLR     R1,     2         ; right-shift by 2 positions
        ANDI    #7,     R1        ; isolate the 3 least significant bits
        ADDR    R7,     R1        ; add the address of our lookup string,
        ADDI    #6,     R1        ; computed as PC + 6
        ANDI    #32,    R0        ; isolate the case bit of the original character
        XOR@    R1,     R0        ; XOR it with the non-accented letter

@@rtn   JR      R5                ; return

        STRING  "ACEIOOU"         ; lookup string

        ENDP

```

### Output

*screenshot from jzIntv*

---

*1. A CP-1610 opcode is encoded with a 10-bit value (0x000 to 0x3FF), known as a 'DECLE'.*

# Answer
> 7 votes
# C (gcc), 37 bytes

A port of my CP-1610 answer.

I/O format: a Unicode code point.

```
f(n){n=n>>7?"ACEIOOU"[n/4&7]^n&32:n;}

```

Try it online!

---

# C (gcc), 45 bytes

I/O format: a Unicode code point.

```
f(n){n=n>>7?"ooieca?UOOIECAu"[n*15%61%15]:n;}

```

Try it online!

# Answer
> 5 votes
# Ruby, 41 bytes

```
->c{c<?~?c:"ACEIOOUxaceioou"[c.ord/4%16]}

```

Try it online!

# Answer
> 4 votes
# PHP 5.4+, 32 bytes

This uses the `htmlentities()` function to return the HTML entity for the character.

```
<?=htmlentities($argn.$argn)[1];

```

For the `"AÁÀÃÂ"` (Ä is missing from the list), it returns `"AÁÀÃÂ"`.
Do you see a problem? The character I want is on position 0 or 1.
So, I just duplicate the input. Problem solved!

You can try this on http://sandbox.onlinephpfunctions.com/code/690dbfcff4c6dec4170954333c62b9b472eaaa93

# Answer
> 3 votes
# Java 8, ~~85~~ ~~70~~ ~~47~~ 39 bytes

```
c->c>122?"ACEIOOU".charAt(c/4&7)^c&32:c

```

-46 bytes by creating a port of *@Arnauld*'s C answer, so make sure to upvote him!

Try it online.

**Original answer (85 bytes):**

```
import java.text.*;c->(char)Normalizer.normalize(c,Normalizer.Form.NFD).getBytes()[0]

```

Try it online.

**Explanation:**

```
c->                         // Method with character as both parameter and return-type
  c>122?                    //  If the character isn't a regular letter:
   "ACEIOOU".charAt(        //   Get the character in String "ACEIOOU" at index:
     c/4&7)                 //    c integer-divided by 4 and then bitwise-ANDed by 7
    ^c&32                   //   And convert it to lowercase if the input was lowercase
  :                         //  Else (it is a regular letter):
   c                        //   Simply return the input as is

import java.text.*;         // Required import for both Normalizer
c->                         // Method with String as parameter and character as return-type
 (char)                     //  Convert the following byte to a character:
   Normalizer.normalize(c,  //   Normalize the input-String,
     Normalizer.Form.NFD)   //   using canonical decomposition
   .getBytes())             //   Convert that to a byte-array (UTF-8 encoding by default)
     [0]                    //   And only leave the first byte

```

# Answer
> 3 votes
# Turing Machine Code, ~~796~~ 286 bytes

```
0 * * r 0
0 Á A r 0
0 À A r 0
0 Ã A r 0
0 Â A r 0
0 Ç C r 0
0 É E r 0
0 Ê E r 0
0 Í I r 0
0 Õ O r 0
0 Ó O r 0
0 Ô O r 0
0 Ú U r 0
0 á a r 0
0 à a r 0
0 ã a r 0
0 â a r 0
0 ç c r 0
0 é e r 0
0 ê e r 0
0 í i r 0
0 õ o r 0
0 ó o r 0
0 ô o r 0
0 ú u r 0
0 _ _ * halt

```

Try it online!

*Saved an incredible 510 bytes thanks to @ovs! That might be some kind of record here on Code Golf*.

# Answer
> 3 votes
# ~~Perl 6~~ Raku, ~~15~~ 14 bytes

```
*.samemark(~0)

```

Try it online!

Returns the string with the same marks/accents as the number `0`, i.e. remove all marks.

# Answer
> 3 votes
# Wolfram Language (Mathematica), 16 bytes

Mathematics is not the only field Mathematica has built-ins for...

```
RemoveDiacritics

```

Try it online! (all the characters are in a single string in the link, but it obviously works character-by-character)

# Sledgehammer, 4 bytes

```
⣕⠬⣠⢹

```

Corresponds to the code `RemoveDiacritics@Input[]`.

# Answer
> 3 votes
# , ~~34~~ 32 bytes

-2 thanks to Giuseppe

```
iconv(scan(,''),,"us//TRANSLIT")

```

Try it online!

# Answer
> 2 votes
# 05AB1E, 53 bytes

-1 thanks to Kevin Cruijssen

```
"áéíõúÁÉÍÕÚàêióuÀÊIÓUãeiôuÃEIÔUâeiouÂEIOUÇç"žÀ4×„Cc«‡

```

Try it online!

## Explanation

"áéíõúÁÉÍÕÚàêióuÀÊIÓUãeiôuÃEIÔUâeiouÂEIOUÇç" A huge lookup table of the unicode characters

žÀ        Push "aeiouAEIOU"
  4×      Repeat it 4 times
    „Cc«  Concatenate "Cc" to the string
        ‡ Transliterate input
```
</code></pre>

# Answer
> 2 votes
# Python 2, 141 bytes

```
o='';i=input()
for x in'AÁÀÃÂ CÇ EÉÊ IÍ OÕÓÔ UÚ aáàãâ cç eéê ií oõóô uú'.split():
 if i in x:o=x[0]
print(o,i)[o=='']

```

Try it online!

Just a simple lookup without any imports. If it finds a "special" character it prints the first character in the string where it is found otherwise just prints the input.

# Answer
> 2 votes
# C (gcc), <sup>~~61~~</sup> 59 bytes

```
g(char*w){w=*w+61?*w:"oeaUICuic OEA"[(256+w[1])*13%59%13];}

```

Try it online!

Uses Arnauld's formula from his JavaScript answer.

# Answer
> 2 votes
# Perl 6, 30 bytes

```
{{S/W.+//}(.uniname).uniparse}

```

Try it online!

# Answer
> 2 votes
# Bash \+ Core utilities, <sup>~~40~~</sup> 32 bytes

```
iconv -f utf8 -t ascii//TRANSLIT

```

Try it online!

# Answer
> 2 votes
# Perl 5 `-pC -MUnicode::Normalize=NFD`, 17 bytes

```
$_=NFD$_;s/\pM//g

```

Try it online!

# Answer
> 2 votes
# Japt, 23 bytes

A port of Arnauld's JS solution. I/O as codepoints.

```
Á7?H&U^`aÅ8`u cU/4&7:U

```

Try it

# Answer
> 2 votes
# C# (Visual C# Interactive Compiler), 39 bytes

```
x=>x.Normalize((NormalizationForm)2)[0]

```

Try it online!

# Answer
> 1 votes
# Retina 0.8.2, 72 bytes (53 characters)

```
T`À-ÃÇÉÊÍÓ-ÕÚà-ãçéêíúó-õ`AAAAC\E\EI\O\O\OUaaaaceeiu\o

```

Try it online! Link includes test cases. Explanation: The Transliterate command has some special characters `E`, `O` and `o`, so these need to be quoted. To avoid repetition, the `o`s are processed last as the last character in the replacement string is automatically repeated. The remaining repetition is one byte less than the overhead of the `T` command; compare this 72-byte 58-character alternative (which also corrupts eth and n with tilde):

```
T`ÚÀ-Ã`UA
T`Ç-Ê`C\E
T`Í-Õ`I\O
T`úà-ã`ua
T`ç-ê`ce
T`í-õ`i\o

```

# Answer
> 1 votes
# perl -MText::Unidecode -pC -e, 14 bytes

```
$_=unidecode$_

```

# Answer
> 1 votes
# Vyxal, 82 bytes / 53 chars

```
`áéíõúÁÉÍÕÚàêióuÀÊIÓUãeiôuÃEIÔUâeiouÂEIOUÇç`k∨4*‛Cc+Ŀ

```

Try it Online!

The bad version, I can't figure out how to port any of the good ones.

# Answer
> 1 votes
# Nim, 45 bytes

```
import unidecode
echo stdin.readAll.unidecode

```

Try it online!

# Answer
> 1 votes
# PowerShell Core, 17 bytes

```
($args|% N* 2)[0]

```

Try it online!

Inspired by the C# answer, thanks Gymhgy!

Takes the input as a string.

Could be shorten down to 14 bytes using a filter, but I don't think it is allowed?

# Answer
> 1 votes
# Vyxal, 18 bytes

```
»æ₁s≥»₄τ?28⋏i?96⋏+

```

Try it Online!

# Answer
> 0 votes
# Jelly, 24 bytes

```
:4ị“CEIOOU A‘^&32$µ>Ø⁷$¡

```

Try it online!

Another port of Arnauld's technique, using codepoint I/O.

# Jelly, 24 bytes

```
&28ị“¦Ðß¤µÐ¢‘+&96$µ>Ø⁷$¡

```

Try it online!

Porting Kevin Cruijssen's 05AB1E solution seems to come out to the same length, but it doesn't feel ungolfable.

Using `unicodedata` comes out considerably longer, if anyone was wondering:

# Jelly, 37 bytes

```
“¦DSƥ4ṖĿẹṁɦ~73°Ñƙ€YḄuḃRṙæṪB\æ“œþ»jŒVḢ

```

Try it online!

---
Tags: code-golf, string, printable-ascii, unicode
---