| Bytes | Lang | Time | Link |
|---|---|---|---|
| nan | Setanta | 240808T055808Z | bb94 |
| 500 | JavaScript Node.js | 240808T050941Z | Andrew B |
| nan | x86 .COM | 230114T124900Z | l4m2 |
| 243 | Python 3 | 210824T181401Z | Jakque |
| 259 | Julia 1.0 | 210824T095307Z | MarcMush |
| 256 | Jelly | 210824T030617Z | Jonathan |
| 297 | ><> | 210824T154608Z | SE - sto |
| 256 | Husk | 210823T162259Z | Dominic |
| 256 | Jelly | 210823T190359Z | Jonathan |
| 141 | Charcoal | 210823T184442Z | Neil |
| nan | Zsh | 210823T181408Z | pxeger |
Setanta, 272 bytes (256 distinct)
Hexdump:
00000000: 6d61 2066 6164 4022 0001 0203 0405 0607 ma fad@"........
00000010: 0809 0a0b 0c5c 5c0d 0e0f 1011 1213 1415 .....\\.........
00000020: 1617 1819 1a1b 1c1d 1e1f 2123 2425 2628 ..........!#$%&(
00000030: 292a 2b2c 2d2e 2f30 3133 3435 3638 393a )*+,-./01345689:
00000040: 3b3c 3d3f 4142 4344 4546 4748 494a 4b4c ;<=?ABCDEFGHIJKL
00000050: 4d4e 4f50 5152 5354 5556 5758 595a 5b5d MNOPQRSTUVWXYZ[]
00000060: 5e5f 6067 7071 7576 7778 797a 7c7e 7f80 ^_`gpquvwxyz|~..
00000070: 8182 8384 8586 8788 898a 8b8c 9d8e 8f90 ................
00000080: 9192 9394 9596 9798 999a 9b9c 9d9e 9fa0 ................
00000090: a1a2 a3a4 a5a6 a7a8 a9aa abac aeaf b0b1 ................
000000a0: b2b3 b4b5 b6b7 b8b9 babd bebd bebf c0c1 ................
000000b0: c2c4 c5c6 c7c8 c9ca cbcc cdce cfd0 d1d2 ................
000000c0: d3d4 d5d6 d7d8 d9da dbdc ddde dfe0 e1e2 ................
000000d0: e3e4 e5e6 e7e8 e9ea ebec edee eff0 f1f2 ................
000000e0: f3f4 f5f6 f7f8 f9fa fbfc fdfe ff22 3e32 .............">2
000000f0: 3237 7b73 6372 c3ad 6f62 6828 276a 616e 27{scr..obh('jan
00000100: 2061 6c65 206f 2c20 746f 6b69 2127 297d ale o, toki!')}
Checks the length of a hardcoded string before printing the message.
JavaScript (Node.js), 500 bytes, 256 distinct
s=0
k="#$%&*-/123456789:<?@BDEFGHIJKLMNOPQRTUVWXYZ\\^_`bfuvwy{|}~
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞ";[...k].map(c=>s+=c.charCodeAt(0))
q=s.toString(11)
console.log('jan ale o, '+[...q].map(x=>'ikt!zzo'[x]).join(''))
x86 .COM , 256/256 byte,
00000000: bff2 01b8 9190 2905 6681 4506 9594 9392 ......).f.E.....
00000010: b409 575a 83ea 03fe 8d2a ffcd 22c3 ???? ..WZ.....*.."...
000000e0: ???? ???? ???? ???? ???? ???? ???? ??6a ...............j
000000f0: 616e b1f1 6c65 206f 978b e0dc 6b69 2124 an..le o....ki!$
asm:
org 100h
mov di, 0x1F2
mov ax, 0x9091
sub [di], ax
add [di+6], dword 0x92939495
mov ah, 9
push di
pop dx
sub dx, 3
dec byte [di-0x1F2+k+1]
k: int 0x22
ret
db 0x1EF-$ dup ?
db 'j'
dw 'an'
dw ' a'+0x9091-0x10000
dd 'le o'
dd ', to'-0x92939495
dd 'ki!$'
Fill the db 0x1EF-$ dup ? with all left bytes
Maybe it's possible to make one with MZ head
Python 3, 243 unique bytes, 265 261 bytes
B=0
input("
#$%&'*+-/25789;<>?@CDFGHMPQRSUVWXYZ^_`bcdghjkmqsvyz{|}~ÜĜŜƜǜȜɜʜ˜̜͜ΜϜРѡҢӣԤե֦קب٩ڪ۫ܬݭޮ߯ఀ᱁Ⲃ㳃䴄嵅涆緇踈鹉꺊뻋켌퍽ᅬ𐑒_JaN ALE \x4f, TOKI!".lower()[136:])
Score !
(the score shows 242 because tio interprets \n and \r the same way)
Note :
as MarcMush pointed, TIO link doesn't like unicodes \U10xxxx. To make my link works, I changed by _ in the code.
Explanation:
the code is equivalent to :
B=0
input("""<bunch of useless stuff>JaN ALE \x4f, TOKI!""".lower()[<index>:])
- store the wanted string upper case and lower it allows to reduce the number of bytes as they would have been stored in the code anyways. I also used
\x4finstead ofOto save 1 byte - if ant byte is removed from the first line, the program will crash due to a syntax error or a Name error.
- if any byte is removed from the string, or the slice, the portion written would not be the correct one.
- if any other byte is removed, the code will crash
Julia 1.0, score 126 242, (269 259 bytes)
lowercase("
#\$&'./;<=?%6890+-gh@BCDFGHJKM࿋ᣤ⢌㯙䡚嶃氼甬蟦鍂ꕇ돲츛톩ñĉūƹǪȀɠʑˎ̿ͥξυЖѓҁӭԜծ֘׳خٓھۧܞݩސߵPQRSUVWXYZ^_`bdfmquvxyz{}~jAN aLE O, TokI!"[213:4*57])|>print
(the first 2 characters of the long string are \r\0)
Check the score (+1 because TIO turns \r into \n)
-10 bytes with Jakque's idea
hexdump
00000000 6c 6f 77 65 72 63 61 73 65 28 22 0d 00 01 02 03 |lowercase(".....|
00000010 04 05 06 07 08 09 0a 0b 0c 0e 0f 10 11 12 13 14 |................|
00000020 15 16 17 18 19 1a 1b 1c 1d 1e 1f 23 5c 24 26 27 |...........#\$&'|
00000030 2e 2f 3b 3c 3d 3f 25 36 38 39 30 2b 2d 67 68 40 |./;<=?%6890+-gh@|
00000040 42 43 44 46 47 48 4a 4b 4d f0 bf bb bd f1 a8 9d |BCDFGHJKM.......|
00000050 9e f2 88 b7 b4 f3 a7 b5 ba e0 bf 8b e1 a3 a4 e2 |................|
00000060 a2 8c e3 af 99 e4 a1 9a e5 b6 83 e6 b0 bc e7 94 |................|
00000070 ac e8 9f a6 e9 8d 82 ea 95 87 eb 8f b2 ec b8 9b |................|
00000080 ed 86 a9 ee 84 8a ef 90 97 c2 92 c3 b1 c4 89 c5 |................|
00000090 ab c6 b9 c7 aa c8 80 c9 a0 ca 91 cb 8e cc bf cd |................|
000000a0 a5 ce be cf 85 d0 96 d1 93 d2 81 d3 ad d4 9c d5 |................|
000000b0 ae d6 98 d7 b3 d8 ae d9 93 da be db a7 dc 9e dd |................|
000000c0 a9 de 90 df b5 50 51 52 53 55 56 57 58 59 5a 5e |.....PQRSUVWXYZ^|
000000d0 5f 60 62 64 66 6d 71 75 76 78 79 7a 7b 7d 7e 7f |_`bdfmquvxyz{}~.|
000000e0 6a 41 4e 20 61 4c 45 20 4f 2c 20 54 6f 6b 49 21 |jAN aLE O, TokI!|
000000f0 22 5b 32 31 33 3a 34 2a 35 37 5d 29 7c 3e 70 72 |"[213:4*57])|>pr|
00000100 69 6e 74 |int|
Explanation
lowercase("long string...jAN aLE O, TokI!"[213:4*57])|>print
- if a byte is missing in the long string, 4*57 will be greater than the length of the string and will error, alternatively, it will produce an incorrect unicode sequence and error as well
- a byte missing in the numbers (213 and 4*57) will give an other substring or error
- a byte missing elsewhere will be a syntax error or an undefined function
lowercaseallows to mix the case in the Hello world and thus reduce the length of the string213:4*57was found by brute-force
I believe this is all I can get with valid UTF-8 sequences
this is getting close to optimal, with only 17 repeated bytes
Jelly, 256 bytes, score 256
Crushed my other answer :)
⁾j¡»“b¢£¥¦©¬®µ½¿ÆÇÐÑaרŒÞßæçðıȷñ÷øœnþ"#$&'()*-.078 :;<=>?@ABCEFGHḥIJKLMNPQRSTUVWlXYZ[\]^_`cdfghempqruvwxyz{|}~Ɲ¶°¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼oƁƇƊƑƓƘⱮƤƬƲȤɓƈɗ,ƒɠɦƙɱɲƥʠɼʂƭʋȥẠṣḄḌẸḤỊḲḶṂṆṚṢṬỤṾtẈỴẒȦḂĊĖḞĠİĿṀṄȮḳṘṠṪẆẊẎŻạḅḍẹịḷṃkṇọṛṭ§ẉỵẓȧḃċḋėḟiġḣŀṁṅȯṗṙṡṫẇẋẏż!”s9123456DḊṖ+/¤Ḣ€O’‘%⁽«ÄỌ
Or try to remove any byte - this will remove the byte at the nth position and evaluate the result as a niladic link.
Some notable byte positions...
- removing any of \$217\$ to \$231\$ (
ġḣŀṁṅȯṗṙṡṫẇẋẏż!) will printjan ale o, tokiwithout the final! - removing \$1\$ (
⁾) will, when run as a full-program, hang waiting for input, and, if an input is given, it will then error comparing an integer to a string (on TIO it will give an EOF error with no pre-prepared input). - removing \$241\$ (
D) will take about 12 seconds but will printj - removing \$256\$ (
Ọ) will print a list of integers, the ordinal values ofjan ale o, toki!.
The base program
A large portion of the code is:
“b¢£¥¦©¬®µ½¿ÆÇÐÑaרŒÞßæçðıȷñ÷øœnþ"#$&'()*-.078 :;<=>?@ABCEFGHḥIJKLMNPQRSTUVWlXYZ[\]^_`cdfghempqruvwxyz{|}~Ɲ¶°¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼oƁƇƊƑƓƘⱮƤƬƲȤɓƈɗ,ƒɠɦƙɱɲƥʠɼʂƭʋȥẠṣḄḌẸḤỊḲḶṂṆṚṢṬỤṾtẈỴẒȦḂĊĖḞĠİĿṀṄȮḳṘṠṪẆẊẎŻạḅḍẹịḷṃkṇọṛṭ§ẉỵẓȧḃċḋėḟiġḣŀṁṅȯṗṙṡṫẇẋẏż!”
Which is a string with runs of \$15\$ bytes:
“b..a..n.. ..ḥ..l..e..Ɲ..o..,..ṣ..t..ḳ..k..i..!”
Here each of the \$15\$ occurrences of .. represents \$14\$ filler bytes that are simply placed arbitrarily (it isn't guaranteed that any placement of the remaining \$210\$ bytes would do but most will).
Replacing that for brevity with “data” the code is:
⁾j¡»“data”s9123456DḊṖ+/¤Ḣ€O’‘%⁽«ÄỌ - Link: no arguments
⁾j¡ - list of characters = "j¡"
“data” - list of characters = the data described above
» - maximum (vectorises)
-> replaces the first character with 'j'
call this newData
¤ - nilad followed by link(s) as a nilad:
9123456 - 9,123,456
D - to decimal digits -> [9,1,2,3,4,5,6]
Ḋ - dequeue -> [1,2,3,4,5,6]
Ṗ - pop -> [1,2,3,4,5]
/ - reduce with:
+ - addition -> 1+2+3+4+5=15
s - split (newData) into slices of length (15)
Ḣ€ - head of each -> "jan ḥleƝo,ṣtḳki!"
O - ordinals
’ - decrement -> ordials - 1
‘ - increment -> ordinals
-> [106,97,110,32,7717,108,101,413,111,44,7779,116,7731,107,105,33]
⁽«Ä - 127
% - (ordinals) modulo (127)
-> [106,97,110,32,97,108,101,32,111,44,32,116,111,107,105,33]
Ọ - cast to characters
-> "jan ale o, toki!"
><>, 297 bytes, score 256
'!ikot ,o ela naj'!;v
"#$%&()*+-./01234567o;
89:<=>?@ABCDEFGHIJKL ;
MNOPQRSTUVWXYZ[\]^_` ;
bcdfghmpqrsuwxyz{|}~ ;
.................... ;
.................... ;
.................... ;
.................... ;
.................... ;
.................... ;
.................... ;
.................... ;
(replace the dots with all the unprintable ascii)
The main idea is fairly simple, removing any byte will block the "print corridor" with the termination character ;
Some notable exceptions:
- Removing the letters in the original phrase will crash the instruction pointer into
J,KorL - Removing a single quote will crash the instruction pointer at
k - Removing
;will crash the instruction pointer atL - Removing newlines or
vwill cause no output to be written.
Husk, 256 256 bytes
Edit: removed '\' character from the filler string, which was otherwise interpreted as an escape signal and not counted towards its length (and so would be deletable).
↓₁-237+6L"¤½↕↑↔←→∟¡¿‼…‰‡√≤≥±∂∫∞≈≠≡⌐÷× #$%&`'()*./014589:;=>?@ABCDEFGHIJKMNOPQRSTUVWXYZ[]^_bcdefghiklmnopqrstuvwxyz{|}~·₂₃₄₅₆₇₈₉⌈⌉⌊⌋ΓΔΘΛΞΠΣΦΨΩαβγδεζηθλμξπρςστφχψω⁰¹²³⁴⁵⁶⁷⁸⁹¢£€¥ƒ´▲▼►◄§ḂĊḊĖĠḢİĿṀṄȮṖṘṠṪẆẊẎŻȧḃċḋėḟġḣıȷŀṁṅȯṗṙṡṫẇẋẏżÄËÏÖÜŸØäëïöüÿø◊□¶«»
¨\ja¬Ȧ¦₀,†Ḟ<!
First attempt using a long compressed string was quickly debunked, so here's one without compression of the filler string...
↓₁ # drop X characters from the compressed string on next line
# which is ¨\ja¬Ȧ¦₀,†Ḟ<!¨ encoding "\jan ale o, toki!"
# Calculate X as:
L" # Length of this non-compressed filler string
# (containing all the other Husk codepoints),
+6 # plus 5,
-237 # minus 257:
# X should equal 1 (to remove the leading '`' character;
# deletion of any character from the filler string yields X=0,
# so the '\' is printed.
Jelly, 256
“¡¢£¤¥¦©¬®µ½¿€ÆÇÐÑרŒÞßæçðıȷñ÷øœþ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi“jklmnopqrstuvwxyz{|}~¶°¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ƁƇƊƑƓƘⱮƝƤƬƲȤɓƈɗƒɠɦƙɱɲƥʠɼʂƭʋȥẠḄḌẸḤỊḲḶṂṆỌṚṢṬỤṾẈỴẒȦḂĊḊĖḞĠḢİĿṀṄȮ“ṖṘṠṪẆẊẎŻạḅḍẹḥịḳḷṃṇọṛṣṭ§Äẉỵẓȧḃċḋėḟġḣŀṁṅȯṗṙṡṫẇẋẏż¡¢£¤¥¦©¬®µ½¿€ÆÇÐÑרŒÞßæçðıȷñ÷øœþ !"#$%&'()*+,-./0123456789:;<=>“?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^“_`abcdefghijklmnopqrstuvwxyz{|}~¶°¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ƁƇƊƑƓƘⱮƝƤƬƲȤɓƈɗƒɠɦƙɱɲƥʠɼʂƭʋȥẠḄḌẸḤỊḲḶṂṆỌṚṢṬỤṾẈỴẒȦḂ“ĊḊĖḞĠḢİĿṀṄȮṖṘṠṪẆẊẎŻạḅḍẹḥịḳḷṃṇọṛṣṭ§Äẉỵẓȧḃċḋėḟġḣŀṁṅȯṗṙṡṫẇẋẏż¡¢£¤¥¦©¬®µ½¿€ÆÇÐÑרŒÞßæçðıȷñ÷øœþ !"#$%&'()*+,-./01“23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~¶°¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ƁƇƊƑƓƘⱮƝ“ƤƬƲȤɓƈɗƒɠɦƙɱɲƥʠɼʂƭʋȥẠḄḌẸḤỊḲḶṂṆỌṚ“ṢṬỤṾẈỴẒȦḂĊḊĖḞĠḢİĿṀṄȮṖṘṠṪẆẊẎŻạḅḍẹḥịḳḷṃṇọṛṣṭ§Äẉỵẓȧḃċḋėḟġḣŀṁṅȯṗṙṡṫẇẋẏż¡¢£¤¥¦©¬®µ½¿€ÆÇÐÑרŒÞßæçðıȷñ÷øœþ !"#$%&'()*+“,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW“XYZ[\]^_`abcdefghijklmnopqrstuvw“xyz{|}~¶°¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ƁƇƊƑƓƘⱮƝƤƬƲȤɓƈɗƒɠɦƙɱɲƥʠɼʂƭʋȥẠḄḌẸḤỊḲḶṂṆỌṚṢṬỤṾẈỴẒȦḂĊḊĖḞĠḢİĿṀṄȮṖṘṠṪẆẊẎŻạḅḍẹḥịḳḷṃṇọṛṣṭ§Äẉỵẓȧḃċḋėḟ“ġḣŀṁṅȯṗṙṡṫẇẋẏż¡¢£¤¥¦©¬®µ½¿€ÆÇÐÑרŒÞßæçðıȷñ÷øœþ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`“abcdefghijklmnopqrstuvwxyz{|}~¶°¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ƁƇƊƑƓƘⱮƝƤƬƲȤɓƈɗƒɠɦƙɱɲƥʠɼʂƭʋȥẠḄḌẸḤỊḲḶṂṆỌṚṢṬỤṾẈỴẒȦḂĊḊĖḞĠḢİĿṀṄȮṖ“ṘṠṪẆẊẎŻạḅḍẹḥịḳḷṃṇọṛṣṭ§Äẉỵẓȧḃċḋėḟġḣŀṁṅȯṗṙṡṫẇẋẏż¡¢£¤¥¦©¬®µ½¿€ÆÇÐÑרŒÞßæçðıȷñ÷øœþ !"#$%&'()*+,-./0123456789:“;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[”Ẉ‘’Ọ«“ŀW»
A full program using all 256 bytes in Jelly's code-page.
I am very confident that this can be beaten since it is a naive attempt using a run-length encoding of the ordinals, which stands at 1368 bytes!
For 251 of the bytes the program will run successfully as a monadic Link - see them all here.
For the other five see these full programs:
removing Ọ fails,
removing Ẉ fails,
removing “ fails,
removing ” fails, and
removing « produces text, but must be run as a full-program
Charcoal, 141 bytes, score 97
⍘⍘!ltoojjjtnn!!iiea,teoikneleaa ¦ !,aeijklnot¦ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
Try it online! Explanation: The string !ltoojjjtnn!!iiea,teoikneleaa is interpreted in the custom base !,aeijklnot and then converted to the custom base of printable ASCII. Removing any of the characters in the custom base will obviously prevent them from being output, but also removing any of the other printable ASCII will scramble the result, while removing the either of the two non-ASCII characters will break the Charcoal program as a whole.
Zsh, score 256 (269 total bytes)
grep -Eax .{240}<<X|cut -f1
jan ale o, toki! "#$%&'()*+/356789:;=>?@ABCDFGHIJKLMNOPQRSTUVWYZ[]^_\`bdhmqsvwyxz~...............................................................................................................................................................
Those .s are all unprintables, so here's a hexdump:
00000000: 6772 6570 202d 4561 7820 2e7b 3234 307d grep -Eax .{240}
00000010: 3c3c 587c 6375 7420 2d66 310a 6a61 6e20 <<X|cut -f1.jan
00000020: 616c 6520 6f2c 2074 6f6b 6921 0922 2324 ale o, toki!."#$
00000030: 2526 2728 292a 2b2f 3335 3637 3839 3a3b %&'()*+/356789:;
00000040: 3d3e 3f40 4142 4344 4647 4849 4a4b 4c4d =>?@ABCDFGHIJKLM
00000050: 4e4f 5051 5253 5455 5657 595a 5b5d 5e5f NOPQRSTUVWYZ[]^_
00000060: 5c60 6264 686d 7173 7677 7978 7a7e 0001 \`bdhmqsvwyxz~..
00000070: 0203 0405 0607 080b 0c0d 0e0f 1011 1213 ................
00000080: 1415 1617 1819 1a1b 1c1d 1e1f 7f80 8182 ................
00000090: 8384 8586 8788 898a 8b8c 8d8e 8f90 9192 ................
000000a0: 9394 9596 9798 999a 9b9c 9d9e 9fa0 a1a2 ................
000000b0: a3a4 a5a6 a7a8 a9aa abac adae afb0 b1b2 ................
000000c0: b3b4 b5b6 b7b8 b9ba bbbc bdbe bfc0 c1c2 ................
000000d0: c3c4 c5c6 c7c8 c9ca cbcc cdce cfd0 d1d2 ................
000000e0: d3d4 d5d6 d7d8 d9da dbdc ddde dfe0 e1e2 ................
000000f0: e3e4 e5e6 e7e8 e9ea ebec edee eff0 f1f2 ................
00000100: f3f4 f5f6 f7f8 f9fa fbfc fdfe ff .............
Needs to be run with LC_ALL=C, because otherwise grep/cut/Zsh get confused by broken Unicode.
Explanation
<<X takes the rest of the file and passes it to grep, which searches for a line containing 241 characters. -E is necessary to activate the {} quantifier, -a forces processing of the input even though it is "binary" not "text", and -x ensures the whole line has to match, not just a substring.
If it matches (i.e. no characters on the second line have been removed), this is passed to cut, which outputs only the 1st field (tab-separated).
If any character on the first line (including the newline) is removed, the search command will break or the pattern won't be matched.
\ escapes the `, because even in a heredoc (<<X), some expansions (importantly ``) are still processed, and otherwise it would be unmatched.
x is duplicated in the second line even though it's already used in the first line, because if it's removed from the grep command then the pattern still matches, but we need it to disallow any of the digits 240 from being removed (otherwise there is always a 20-character substring of that line, or whatever)