| Bytes | Lang | Time | Link |
|---|---|---|---|
| 901 | Bespoke | 250819T101303Z | Josiah W |
| 026 | Vyxal 3 | 250417T201027Z | Weird Gl |
| 074 | Raku Perl 6 rakudo | 250417T193728Z | xrs |
| 065 | JavaScript V8 | 210323T172311Z | Arnauld |
| 126 | tinylisp | 250331T040033Z | Andrew B |
| 072 | Nim | 250331T052138Z | janAkali |
| 063 | Javascript console expression | 250331T014022Z | Steve Be |
| 064 | C gcc | 250330T125027Z | l4m2 |
| 051 | APL Dyalog | 250328T150244Z | noodle p |
| 117 | SAKO | 250328T115427Z | Acrimori |
| 044 | Vyxal | 221015T092531Z | DialFros |
| 070 | Batch | 220506T012110Z | Youserna |
| 083 | TIBasic | 220429T214906Z | Youserna |
| 113 | Lost A | 220429T093616Z | Kevin Cr |
| 059 | Ly | 220429T084019Z | cnamejj |
| 447 | Turing Machine Code | 220109T132808Z | ouflak |
| 063 | Haskell | 220226T182308Z | lynn |
| 046 | Foo | 220226T124855Z | jimmy230 |
| 064 | Google Sheets | 220225T185557Z | user1111 |
| 101 | JavaScript | 220111T133245Z | CreaZyp1 |
| 051 | Pip | 220107T211005Z | DLosc |
| 063 | AsciiDots | 210608T151530Z | JathOsh |
| 125 | Hexagony | 210608T133606Z | a stone |
| 068 | AWK | 210608T044555Z | Pedro Ma |
| 050 | Knight c/golf | 210608T012843Z | EasyasPi |
| nan | 210607T204708Z | KinuTheD | |
| 061 | Julia | 210505T095418Z | MarcMush |
| 078 | Python 3 | 210505T073403Z | Rachit A |
| 060 | JavaScript V8 | 210504T183445Z | l4m2 |
| 063 | Rust | 210325T180239Z | cg909 |
| 070 | Excel | 210323T172323Z | Axuary |
| 054 | Zsh | 210323T170931Z | pxeger |
| 063 | R | 210325T114804Z | Robin Ry |
| 058 | Python 2 | 210325T120302Z | xnor |
| 064 | PHP | 210325T083436Z | Kaddath |
| 065 | Python 2 | 210324T105721Z | user1017 |
| nan | Pxem | 210324T084411Z | user1004 |
| 025 | Jelly | 210323T164248Z | caird co |
| 072 | Python 3.8 prerelease | 210323T174251Z | wasif |
| 072 | Java | 210323T185615Z | Unmitiga |
| 054 | shortC | 210324T115935Z | Cinaski |
| 060 | PowerShell 7 | 210323T164237Z | Zaelin G |
| 078 | Befunge93 | 210324T091502Z | Redy000 |
| 066 | Groovy | 210324T082222Z | M. Justi |
| nan | Factor | 210323T213241Z | hdrz |
| 069 | C gcc | 210324T063334Z | ErikF |
| 035 | Stax | 210324T041539Z | Razetime |
| 023 | Husk | 210324T002658Z | Leo |
| 053 | 33 | 210324T003221Z | TheOnlyM |
| 034 | Emotion | 210323T233326Z | Quantum6 |
| 062 | ><> | 210323T220134Z | kops |
| 027 | 05AB1E | 210323T215228Z | ovs |
| nan | Scratch 3.0 | 210323T215054Z | lyxal |
| 090 | SNOBOL4 CSNOBOL4 | 210323T214711Z | Giuseppe |
| 043 | Charcoal | 210323T195225Z | Neil |
| 051 | Retina 0.8.2 | 210323T194241Z | Neil |
| 031 | Husk | 210323T191406Z | 79037662 |
| 061 | APL Dyalog Classic | 210323T184700Z | Andrew O |
| 073 | Python | 210323T182411Z | user1006 |
| 060 | Wolfram Language Mathematica | 210323T180828Z | att |
| 065 | Python 2 | 210323T180156Z | Jonathan |
| 036 | Japt | 210323T172633Z | Etheryte |
| 066 | Python 2 | 210323T163846Z | Manish K |
| 024 | Jelly | 210323T165706Z | Adam |
| 090 | Scala 3 | 210323T164757Z | user |
Bespoke, 901 bytes
PUSH I
STACKTOP MINUSONE
PUT XXXXXXXXXX:TRI TRI I INTEIGHT FIFTH SEVENTH SEVENTH FOUR BI INTEIGHT
CONTINUED XXXXXXXXXX:NUMBERZERO BI FOUR FOUR DIGITNINE INTEIGHT BI FIFTH NUMBERZERO NUMBERZERO
CONTINUED XXXXXXXXXX:I I BI BI INTEIGHT FIFTH NUMBERZERO I I FIFTH
CONTINUED XXXXXXXXXX:DIGITNINE FOUR I I FOUR TRI TRI INTEIGHT I SEXTET
CONTINUED XXXXXX:FIFTH TRI NUMBERZERO I FIFTH TRI
STACKTOP PRODUCTOF
PUT XXXXXXXXXX:FOUR I INTEIGHT SEVENTH BI TRI SEVENTH INTEIGHT I NUMBERZERO
CONTINUED XXXXXXXXXX:FOUR I FIFTH SEVENTH FOUR BI NUMBERZERO SEXTET NUMBERZERO NUMBERZERO
CONTINUED XXXXXXXXXX:SEVENTH INTEIGHT BI SEVENTH FIFTH SEXTET INTEIGHT INTEIGHT SEVENTH DIGITNINE
CONTINUED XXXXXXXXXX:I DIGITNINE TRI TRI TRI DIGITNINE DIGITNINE FOUR SEXTET TRI
CONTROL DOWHILE
DO COPY
CONTROL WHILE
DO COPY
PUT XXX:I BI BI;STACKTOP MODULO
OUTPUT CH
PUT XXX:I BI BI;STACKTOP QUOTIENTOF
DO COPY
CONTROL END
DO P
DO COPY
The nineteenth byte is the first N in MINUSONE.
Because Bespoke doesn't have strings, I encode the two parts of the message in the base-122 digits of two very large numbers:
- 6637154856048996500022457002318822867633060306 =
- The Nineteenth Byte - 4187237810415742060078275688791933399463 =
Stack Exchange Chat
(NOTE: I actually store half of the number for - The Nineteenth Byte - i.e. 3318577428024498250011228501159411433816530153 - for a reason I'll get to shortly.)
The main loop of the program is simple; for each value on the stack, it outputs its base-122 digits as characters from LSD to MSD. This happens until the top stack value is 0 (or a stack underflow occurs).
With the nineteenth byte included, the first few commands are PUSH I STACKTOP MINUSONE, which pushes 1 and immediately decrements it to 0. This value is then multiplied with the value which stores - The Nineteenth Byte, making it 0 and preventing it from being decoded.
With the nineteenth byte removed, the first few commands become PUSH I STACKTOP MIUSONE - equivalent to PUSH I STACKTOP PLUSONE - which pushes 1 and immediately increments it to 2. When this is multiplied with the halved - The Nineteenth Byte value, it is doubled to its correct value, and it is decoded in the main loop.
There might be a more clever approach I could take to this, but this is the first approach I could think of. If anyone has any suggestions, let me know!
Vyxal 3, 27 26 bytes
"
⇧∻⨪⍟ø④≛∺Ṫɾ)y6⊐”½wh#wᏜ -j
A small explanation:
"
⇧∻⨪⍟ø④≛∺Ṫɾ)y6⊐”½wh#wᏜ -j
" # "Stack Exchange Chat The Nineteenth Byte"
⇧∻⨪⍟ø④≛∺Ṫɾ)y6⊐”
½ # Cut string in half (["Stack Exchange Chat", " The Nineteenth Byte"])
w # 19th byte, wrap list ([["Stack Exchange Chat", " The Nineteenth Byte"]])
h # Get head of list ("Stack Exchange Chat" or ["Stack Exchange Chat", " The Nineteenth Byte"])
#w # Ensure wrapping ("Stack Exchange Chat" becomes ["Stack Exchange Chat"])
Ꮬ -j # Join on " -"
💎
Created with the help of Luminespire.
Raku (Perl 6) (rakudo), 74 bytes
my$s="Stack ";my $n=" - The Nineteenth Byte";say $s~"Exchange Chat"~(my$n)
Changes variable name from $n to $.
JavaScript (V8), 65 bytes
-1 thanks to Andrew Bayly
The nineteenth byte is the X.
print("Stack",(s="X"&&"- The Nineteenth Byte","Exchange Chat"),s)
Try it online! (nineteenth byte removed)
Commented
print( // print:
"Stack", // the first word and an implicit space
( //
s = "X" && // define s as either "- The Nineteenth Byte"
"- The Nineteenth Byte", // or an empty string if the 'X' is removed
"Exchange Chat", // append "Exchange Chat" and an implicit space
s // followed by s
) //
) // end
tinylisp, 262 188 126 bytes
(d S (a 17 24
(d H(q((k U)(i k(c(s(h U)1)(H(s k 1)(t U)))(
(string(H S(chars(q Tubdl!Fydibohf!Dibu!.!Uif!Ojofuffoui!Czuf
Thanks to @emanresu A.
The nineteenth byte is the 4 at the end of the first line.
The string is encoded by adding 1 to the char-code of each character which removes spaces. H is the decoding function.
Nim, 72 bytes
echo`[]`(x=0..min(118,40),s="Stack Exchange Chat - The Nineteenth Byte")
echo`[]`(x=0..min(18,40),s="Stack Exchange Chat - The Nineteenth Byte")
Ungolfed:
echo "Stack Exchange Chat - The Nineteenth Byte"[0..min(118,40)]
Explanation:
Nim treats most operators as regular functions that can be called in different ways, see UFCS
The backticks allow us to call the slice operator
[]as a normal functionUsing named arguments we specify the parameters in a reverse order
Javascript console expression (63 bytes)
a=' Exchange Chat /- The Nineteenth Byte'.split`/`[0],'Stack'+a
C (gcc), 64 bytes
f(){printf("%shat\40- The Nineteenth Byte","Stack Exchange C");}
C (gcc), 67 bytesto compare with ErikF's answer
main(){printf("%s\40- The Nineteenth Byte","Stack Exchange Chat");}
APL (Dyalog), 51 bytes
⎕←'Stack Exchan'⍪70↑'ge Chat - The Nineteenth Byte'
The 19th byte of the source is 0. If it is removed, it takes seven chars from the following string, giving ge Chat. If not, it takes 70, which is more than the length of the string so the whole thing is returned.
(I put down "Dyalog" but this should really run in any implementation.)
SAKO, 117 bytes
GDY1=0:12,INACZEJ12
12)TEKST
Stack Exchange Chat - The Nineteenth Byte
STOP1
1)TEKST
Stack Exchange Chat
STOP1
KONIEC
Normally jumps to 12, but when the byte is removed jumps to 1.
Without the 19th byte
GDY1=0:12,INACZEJ1
12)TEKST
Stack Exchange Chat - The Nineteenth Byte
STOP1
1)TEKST
Stack Exchange Chat
STOP1
KONIEC
Vyxal, 44 bytes
⟨`⟩τ •› °ʀ`||` - λƛ ∵∷⟑⌈th ₁ḋ`⟩:£ṅ\+c[¥h|¥ṅ]
When removing the 19th byte it gives:
⟨`⟩τ •› °ʀ`||` - λ ∵∷⟑⌈th ₁ḋ`⟩:£ṅ\+c[¥h|¥ṅ]
Batch, 70 bytes
set as=e Chat
set as=%as% - The Nineteenth Byte
echo Stack Exchang%as%
TI-Basic, 83 bytes
"nge Chat
If 01
Ans+" - The Nineteenth Byte
"Stack Excha"+Ans
-1 byte by replacing i with the imaginary number i
TI-Basic is tokenized, so the nineteenth byte is 1. Despite being 83 bytes, this is not compatible with the TI-83.
Lost -A, 113 bytes
>%?"Stack Exch2/"+\"nge Chat"@
^/+"/% - tahC egn"<
?>"he Nineteenth Byt6/"+@v
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
^<<"
The 19th byte is the \ on the first line.
Try it online or verify that it's deterministic.
Try it online without 19th byte or verify that that is deterministic.
Explanation:
Explanation of the language in general:
Lost is a 2D path-walking language. Most 2D path-walking languages start at the top-left position and travel towards the right by default. Lost is unique however, in that both the start position AND starting direction it travels in is completely random. So making the program deterministic, meaning it will have the same output regardless of where it starts or travels, can be quite tricky.
A Lost program of 2 rows and 5 characters per row can have 40 possible program flows. It can start on any one of the 10 characters in the program, and it can start traveling up/north, down/south, left/west, or right/east.
In Lost you therefore want to lead everything to a starting position, so it'll follow the designed path you want it to. In addition, you'll usually have to clean the stack when it starts somewhere in the middle.
Explanation of the program:
All arrows, including the reflects / in the strings, will lead the path towards the leading > on the first line. From there the program flow is as follows:
>: Travel towards the right%: Put the safety 'off'. In a Lost program, an@will terminate the program, but only when the safety is 'off'. When the program starts, the safety is always 'on' by default, otherwise a program flow starting at the exit character@would immediately terminate without doing anything. The%will turn this safety 'off', so when we now encounter an@the program will terminate (if the safety is still 'on', the@will be a no-op instead).?: Clean the top value on the stack. In some program flows it's highly likely we have a partial string on the stack, so we use this to wipe the stack clean of that potential string. (Minor note: if the stack was not empty when?is encountered, the next operation will be skipped.)": Start a string, which means it will push the integer code-points of the characters used.Stack Exch2/: Push the code-points for these characters, being83 116 97 99 107 32 69 120 99 104 50 47respectively": We're done pushing code-points of this string+: Add the top two values together: (50+47=)97- With 19th byte:
\: Reflect the direction downwards<: Change the direction towards the left": Start a string againnge Chat - %/: Push the code-points110 103 101 32 67 104 97 116 32 45 32 37 47": We're done pushing code-points again+: Add the top two values together: (37+47=)84/: Reflect the direction downwards>: Change the direction towards the right"he Nineteenth Byt6/"+: The same yet again@: Terminate the program if the safety is 'off' (which it is at this point). After which all the values on the stack will be output implicitly. Using the-Aprogram argument flag, these code-points will be output as characters instead.
- Without the 19th byte:
"nge Chat": Push the code-points110 103 101 32 67 104 97 116@: Similar again: terminate the program if the safety is 'off' (which it is at this point), and output the values on the stack implicitly (as characters because of the-Aflag).
Some things to note:
- The leading
?on the third line instead of a^is to clean a second unwanted value from the stack, which happens (among others) for the flow {first row, third character, traveling downwards}. - The bottom row
^<<", and primarily the", is for the flow {first row, fourth character, traveling upwards}, which would otherwise keep pushing strings without changing directions. - The trailing
von the third line is for the flow {first row, third character, traveling right}, which skipped the%to put the safety off, and would end up in an infinite loop traveling left on the third line. - The
/in the strings are to prevent infinite loops as well. The one in"Stack Exch2/"+for flow {first row, second character, traveling downward}; the one in"/% - tahC egn"for flow {second row, fourth character, traveling left}; and the one in"he Nineteenth Byt6/"for flow {third row, third character, traveling left}.
Ly, 59 bytes
"Stack Exchange "0`sp"Chat"&o"etyB htneeteniN ehT - "l*[o];
This code stashes a 0 or 1 depending on whether or not the 19th character is deleted. Then that value is pull back to conditionally print the extra characters after the string both outputs have in common is printed.
1. Handles the string both outputs have in common
"Stack Exchange " - push the start of the common string
0`sp - full code, push 0, increment, save "1"
-- or --
0sp - w/ 19th char dropped, saves "0"
"Chat" - push the rest of the common string
&o - print stack as string, reverse order
2. Deal with the optional string
"etyB htneeteniN ehT - " - push remaining string, in reverse
l* - load saved value multiply top of stack
[o] - while top of stack!=0, print as char
; - exit to avoid printing the stack
Turing Machine Code, 428 447 bytes
0 _ _ * 3
1 _ _ * 32
2 _ _ l halt
3 _ S r 4
4 _ t r 5
5 _ a r 6
6 _ c r 7
7 _ k r 8
8 _ _ r 9
9 _ E r a
a _ x r b
b _ c r c
c _ h r d
d _ a r e
e _ n r f
f _ g r g
g _ e r h
h _ _ r i
i _ C r j
j _ h r k
k _ a r l
l _ t r 1
32 _ _ r H
H _ - r I
I _ _ r m
m _ T r o
o _ h r p
p _ e r q
q _ _ r r
r _ N r s
s _ i r t
t _ n r u
u _ e r v
v _ t r w
w _ e r x
x _ e r y
y _ n r z
z _ t r A
A _ h r B
B _ _ r C
C _ B r D
D _ y r E
E _ t r G
G _ e * halt
Without 19th:
0 _ _ * 3
1 _ _ * 2
2 _ _ l halt
3 _ S r 4
4 _ t r 5
5 _ a r 6
6 _ c r 7
7 _ k r 8
8 _ _ r 9
9 _ E r a
a _ x r b
b _ c r c
c _ h r d
d _ a r e
e _ n r f
f _ g r g
g _ e r h
h _ _ r i
i _ C r j
j _ h r k
k _ a r l
l _ t r 1
32 _ _ r H
H _ - r I
I _ _ r m
m _ T r o
o _ h r p
p _ e r q
q _ _ r r
r _ N r s
s _ i r t
t _ n r u
u _ e r v
v _ t r w
w _ e r x
x _ e r y
y _ n r z
z _ t r A
A _ h r B
B _ _ r C
C _ B r D
D _ y r E
E _ t r G
G _ e * halt
Thanks to @Makonede for spotting the hyphen gaff.
Haskell, 63 bytes
main=putStr$take 119"Stack Exchange Chat - The Nineteenth Byte"
The 19th byte is the center 1 in 119.
Foo, 46 bytes
"Stack Exchange Ch"at"at - The Nineteenth Byte
Output the quoted strings, which don't have to be closed. Other commands don't matter.
Google Sheets, 64 bytes
="Stack Excha"&if(1,"nge Chat - The Nineteenth Byte","nge Chat")
JavaScript, 101 bytes
console.log([[,].splice().length?"":" - The Nineteenth Byte","Stack Exchange Chat"].reverse().join``)
Try it Online!, without the 19th byte
It's not the best answer in JavaScript, but I think it's interesting because the 19th byte is p of splice, making slice:
[,].splice.length == 0 //Falsey
[,].slice.length == 2 //Truthy
It might be golfed more, but idk.
Pip, 51 bytes
O"Stack Exchange "Y" - The Nineteenth Byte""Chat".y
Explanation
; Output "Stack Exchange " without a trailing newline
O"Stack Exchange "
; 19th character is Y; with it, yank " - The Nineteenth Byte" into the y variable
; Without Y, the string by itself is a no-op and y keeps its initial value of ""
Y" - The Nineteenth Byte"
; Concatenate "Chat" with y and autoprint the result
"Chat".y
AsciiDots, 63 bytes
/' kcatS'_$-..----\
\$_'Exchange Chat'~$' - The Nineteenth Byte
I feel like I can still save a byte or two but I am unsure.
Hexagony, 125 bytes
S;t;a;\;c;h;a\ch;a$].\\;aC;$@h;\;n;"T;h;e\a;tt;e;e;n\;{;";.t;e;@\t;h;..;k;{32;"E;x.n;g;e;{;C;.;g;e;{;"C;{;'45;}.N;i;n;e;{;B;y
Try it online!
Try it without 19th Byte!
Expanded versions:
Original:
S ; t ; a ; \
; c ; h ; a \ c
h ; a $ ] . \ \ ;
a C ; $ @ h ; \ ; n
; " T ; h ; e \ a ; t
t ; e ; e ; n \ ; { ; "
; . t ; e ; @ \ t ; h ; .
. ; k ; { 3 2 ; " E ; x
. n ; g ; e ; { ; C ;
. ; g ; e ; { ; " C
; { ; ' 4 5 ; } .
N ; i ; n ; e ;
{ ; B ; y . .
Without 19th:
S ; t ; a ; \
; c ; h ; a \ c
h ; a ] . \ \ ; a
C ; $ @ h ; \ ; n ;
" T ; h ; e \ a ; t t
; e ; e ; n \ ; { ; " ;
. t ; e ; @ \ t ; h ; . .
; k ; { 3 2 ; " E ; x .
n ; g ; e ; { ; C ; .
; g ; e ; { ; " C ;
{ ; ' 4 5 ; } . N
; i ; n ; e ; {
; B ; y . . .
Knight (c/golf), 50 bytes
O+"Stack Exchange"+" Chat"" - The Nineteenth Byte"
Every Knight program is actually one expression. It has to manually chain each statement, typically using ;.
So for example:
OUTPUT "Hello"
OUTPUT "World!"
will only output Hello because output only has one argument. Everything else is undefined behavior, but almost all interpreters ignore it.
So therefore, we can easily truncate a program by breaking the "link".
So in my program, the nineteenth byte is this +.
O+"Stack Exchange"+" Chat"" - The Nineteenth Byte"
~~~~~~~~~~~~~~~~~~^
When the + is there, it is parsed as this:
# Concatenate " Chat" and " - The...", append to "Stack Exchange" and output
OUTPUT +("Stack Exchange" +(" Chat" " - The Nineteenth Byte"))
When we remove it, it is parsed as so:
# Concatenate "Stack Exchange" and " Chat", then output
OUTPUT +("Stack Exchange" " Chat")
# ignored because we no longer are concatenating
# " - The Nineteenth Byte"
Python 3, 101 bytes
def f(gh):
gh()
"#";print(" - The Nineteenth Byte")
f(lambda:print(end="Stack Exchange Chat"))
Try it online! Minus the 19th byte:
def f(gh):
gh()
#";print(" - The Nineteenth Byte")
f(lambda:print(end="Stack Exchange Chat"))
Try it online! Explanation: Removing a " allows the # symbol to be used as a comment. Yes, I know this isn't very golfed.
-3 and fixed thanks to Makonede.
Julia, 61 bytes
s=" Exchange Chat"*
" - The Nineteenth Byte";print("Stack"*s)
port of xnor's answer
* is the 19th byte.
with the *, the expression is incomplete so it continues an the next line. Without it, the expression ends and the next string is useless
Python 3, 78 bytes
exit(('%s %s %s '+10//10*'- The Nineteenth Byte')%('Stack','Exchange','Chat'))
Poor attempt but different. removing the 19th character will make it 0//10 and therefore the second string won't be printed.
JavaScript (V8), 60 bytes
e="Exchange Chat "+
"- The Nineteenth Byte"
print("Stack",e)
Rust, 63 bytes
||print!("Stac{:.105}","k Exchange Chat - The Nineteenth Byte")
The nineteenth byte is the 0 in the formatting parameter.
Removing it changes the format string in the closure to print 15 characters from the argument instead of up to 105.
With the 19th byte: Try it online!
Without the 19th byte: Try it online!
Thanks to @ErikF for his inspiring C solution
Excel, 73 70 bytes
Updated thanks to @EngineeringToast
=LET(a,"Stack ",b,1,a&"Exchange Chat"&IF(b," - The Nineteenth Byte",))
Original
=LET(s,"Sta",n,30--11,LEFT(s&"ck Exchange Chat - The Nineteenth Byte",n))
Shows all characters as is; the left 19 characters if the 19th byte (-) is deleted.
Zsh, 54 bytes
set Exchange Chat \
- The Nineteenth Byte
<<<Stack\ $@
set assigns the given words to the default variable $@. As with the previous one, \ joins the two lines into one call to set, instead of treating - The Nineteenth Byte as a command (which does nothing).
Zsh, 55 bytes
1=" Exchange Chat"\
" - The Nineteenth Byte"
<<<Stack$1
Idea boringly copied from @xnor's genius answer. The \ escapes the newline, which concatenates the two strings; without it, the second line is ignored as an undefined command.
Zsh, 58 bytes
1=Stack\ Exchang
2=" - The Nineteenth Byte"
<<<$1e\ Chat$2
The 19th byte is the second =, which changes that line from a variable assignment to an undefined command which does nothing. Then, when printing, $2 defaults to empty.
R, 72 68 63 bytes
-4 bytes thanks to Dominic van Essen.
cat(scan(,"",3+0004))
Stack Exchange Chat - The Nineteenth Byte
The 19th byte is the 4. In the unaltered version, scan will read 7 words from the next line, and then print them. If you remove the 4, scan will read only 3 words and then print them.
Python 2, 58 bytes
s="Exchange Chat "\
"- The Nineteenth Byte"
print"Stack",s
The 19th byte is the \ at the end of the first line. It acts as a line continuation character to make the full line be "Exchange Chat ""- The Nineteenth Byte" using Python's automatic concatenation of adjacent string literals.
Without the \, the line ends there, and the second line is lonely string value that doesn't do anything. The truncated string ends in a space, which is fine because the challenge allows for trailing whitespace.
Python 2, 61 bytes
s="Exchange Chat"+--1*" - The Nineteenth Byte"
print"Stack",s
The 19th byte is a -. Originally we append --1 (so, 1) copies of the string " - The Nineteenth Byte", with the 19th byte is removed, this is -1 copies which is nothing.
PHP, 64 bytes
<?="Stack Excha".(!($a="nge Chat")?:"$a - The Nineteenth Byte");
A kinda trivial answer: the 19th byte is the !. Note that in PHP's ternary conditions a?b:c, if b is missing, a's value is used instead.
Python 2, 65 bytes
a="Exchange Chat"
"#";a+=" - The Nineteenth Byte"
print"Stack",a
The nineteenth byte is the quotation mark before the hashtag. Removing it turns line 2 into a comment.
Works in Python 3 for 67 bytes, by adding brackets for the print() function.
Pxem, filename: 2 bytes + content: 64 bytes = 66 bytes.
Thank you for commenting me that I need to use content of the file.
Filename
.e
Content
Stack Exchange Cha.p.c.c.zt - The Nineteenth Byte.p.d.a.v.st.v.p
How it works
- Every command substring consists of a dot and a char.
- Every non-command substring is considered to be a command to push each of the string from backwards.
- I.e. literals.
- Filename is main routine; content is subroutine.
.ecalls subroutine.- 19th byte on content is
.of.p--- a command to pop each to putchar().- Then the stack would be empty.
.cis dup() iff not empty; nop() otherwise..z ... .aiswhile size<2 || pop!=pop; do ... ;done..dis exit() on filename;returnon content..vreverses entire stack.
Links to TIO
Jelly, 25 bytes
“¡TƑ9ı2ṆR“¡⁸¢6ṅȯ*ỵ#K»iƇ”h
Try it online! or Try it without #
Jelly, 25 bytes
“¡TƑ9ı2ṆR“¡TḟKY=ɱø~»tƑƇ⁶K
Try it online! or Try it without ~
How they work
“¡TƑ9ı2ṆR“¡⁸¢6ṅȯ*ỵ#K»iƇ”h - Main link. No arguments
“¡TƑ9ı2ṆR“¡⁸¢6ṅȯ*ỵ#K» - Pair of compressed strings ["Stack Exchange Chat", " - The Nineteenth Byte"]
Ƈ - Keep those for which the following is True:
i ”h - They contain "h"; ["Stack Exchange Chat", " - The Nineteenth Byte"]
Smash together and output
“¡TƑ9ı2ṆR“¡⁸¢6ṅȯ*ỵK»iƇ”h - Main link. No arguments
“¡TƑ9ı2ṆR“¡⁸¢6ṅȯ*ỵK» - Pair of compressed strings ["Stack Exchange Chat", "^Backets reamyappenzell"]
Ƈ - Keep those for which the following is True:
i ”h - They contain "h"; ["Stack Exchange Chat"]
Smash together and output
And the second one:
“¡TƑ9ı2ṆR“¡TḟKY=ɱø~»tƑƇ⁶K - Main link. No arguments
“¡TƑ9ı2ṆR“¡TḟKY=ɱø~» - Pair of compressed strings ["Stack Exchange Chat", "- The Nineteenth Byte"]
ƑƇ - Keep those where the following has no effect:
t ⁶ - Removing spaces from the front and end; ["Stack Exchange Chat", "- The Nineteenth Byte"]
K - Join with spaces; "Stack Exchange Chat - The Nineteenth Byte"
“¡TƑ9ı2ṆR“¡TḟKY=ɱø»tƑƇ⁶K - Main link. No arguments
“¡TƑ9ı2ṆR“¡TḟKY=ɱø» - Pair of compressed strings ["Stack Exchange Chat", " Backets reamyappenzell"]
ƑƇ - Keep those where the following has no effect:
t ⁶ - Removing spaces from the front and end; ["Stack Exchange Chat"]
K - Join with spaces; "Stack Exchange Chat"
Python 3.8 (pre-release), 72 bytes
print('Stack Exch{1}'.format(x:='ange Chat',x+' - The Nineteenth Byte'))
Different approach than @ManishKundu solution
Nineteenth byte is 1 removing it will result 0 to only suffix hange Chat
Thanks to @ZaelinGoodman for insight
-6 bytes to @Makonede
Java, 104 83 72 bytes
$->"Stack ExchangeA Chat".replaceAll("A(.*)","$1 - The Nineteenth Byte")
The nineteenth byte is A.
Saved 21 bytes thanks to 79037662.
Saved 11 bytes thanks to Olivier Grégoire.
shortC, 54 bytes
Ds"Exchange Chat\x20- The Nineteenth Byte"
AJ"Stack "s
Without the Nineteenth byte
Ds"Exchange Chat\x0- The Nineteenth Byte"
AJ"Stack "s
\x20 denotes a space character, removing the 2 we get \x0 (null character) which in C is the string terminator.
PowerShell 7, 60 bytes
'Stack Exchange'+(!0 ?' Chat - The Nineteenth Byte':' Chat')
# ^
# 19th byte
No TIO because the ternary operator is not supported in powershell 6 and below
Alternate Solutions
PowerShell 7, 60 bytes
"Stack Exchan$($x=!0 ?' - The Nineteenth Byte':'')ge Chat$x"
# ^
# 19th byte
PowerShell, 61 58 bytes
-3 bytes thanks to @mazzy!!
"Stack Exchange {01}"-f'Chat','Chat - The Nineteenth Byte'
# ^
# 19th byte
Befunge-93, 78 bytes
v>"xe kcatS" >:#,_#@"etyB htnee"v
v^"chang"<>:#,_@#" - The Ninet"<
>"tahC e"^
The 19th byte is the '#' right before '@' on the first line. If it is removed, execution will stop at '@'.
Explanation
v>"xe kcatS" Pushes the first section of the string
v^"chang"<
>"tahC e"^
>:#,_ Prints it
#@ '#' is the 19th byte, it will skip the '@'. If it's removed
the execution will stop at '@'
"etyB htnee"v Push the second section of the string (there is an extra space
" - The Ninet"< because one char is lost when printing)
>:#,_@# Prints it
Groovy, 66 bytes
m='change Chat'+(01?' - The Nineteenth Byte':'')
print'Stack Ex'+m
Without 19th byte
m='change Chat'+(0?' - The Nineteenth Byte':'')
print'Stack Ex'+m
Factor, 95 94 87 bytes
Saved 1 precious byte thanks to @OriginalOriginalOriginalVI! Saved 7 more bytes thanks to @Bubbler!
"Stack Exchange C"f " - The Nineteenth Byte""hat"rot [ prepend nip ] [ glue ] if* print
Explained:
"Stack Exchange C"f " - The Nineteenth Byte""hat" ! push items on the stack,
! f (false) value is 19th char
rot ! rotate, f now at top of stack
! if f is missing, "Stack Exchange C"
! is at the top
[ prepend nip ] [ glue] if* print ! if* f is found, glue the strings and print.
! if* a string is found, it is considered to
! be true, retain it on the stack, swap & glue
! the top strings, drop the "19th Byte" string,
! append and print.
Old version:
"Stack Exchange C"f "hat"" - The Nineteenth Byte"rot [ nip swap append ] [ 3append ] if* print
Explained:
"Stack Exchange C"f "hat"" - The Nineteenth Byte" ! push items on the stack,
! f (false) value is 19th char
rot ! rotate, f now at top of stack
! if f is missing, "Stack Exchange C"
! is at the top
[ nip swap append ] [ 3append ] if* print ! if* f is found, append the strings and print.
! if* a string is found, it is considered to
! be true, retain it on the stack, drop the
! "19th Byte" string, swap stack strings,
! append and print.
C (gcc), 69 bytes
Without the removal of the 19th byte, the full string (which is much less than 119 characters) is printed; if the 19th byte is removed, only 19 characters are printed instead.
main(){printf("%.119s","Stack Exchange Chat - The Nineteenth Byte");}
With the 19th byte removed: Try it online!
Stax, 35 bytes
`/yT)6bX$`p 01D`|<<T,/-Gk5gD8/
Remove the nineteenth byte(booooo)
The compressed literal for the whole string is > 19 bytes, so it has to be split for a working solution (unless wastl finds some insane compression exploit)
Husk, 25 23 bytes
ΣüL½¨ḟKȦΞ×ėCȧt-ξḟ%Nhβ/y
Try it online without the 19th byte!
Explanation
¨ḟKȦΞ×ėCȧt-ξḟ%Nhβ/y is a compressed string, equivalent to "Stack Exchange Chat - The Nineteenth Byte". If we remove N (the nineteenth byte of the program) we get ¨ḟKȦΞ×ėCȧt-ξḟ%hβ/y, which is equivalent to "Stack Exchange Chat - Thefischer\n Byte" (\n being a newline character).
Now, starting from one of these two strings:
"Stack Exchange Chat - The Nineteenth Byte" "Stack Exchange Chat - Thefischer\n Byte"
½ Split the string in half
["Stack Exchange Chat -", ["Stack Exchange Chat",
" The Nineteenth Byte"] " - Thefischer\n Byte"]
üL nub by length: remove strings with the same length as previous ones
["Stack Exchange Chat -", ["Stack Exchange Chat"]
" The Nineteenth Byte"]
Σ Join the strings together
"Stack Exchange Chat - The Nineteenth Byte" "Stack Exchange Chat"
33, 53 bytes
"Stack Exchange "1cp"Chat"p" - The Nineteenth Byte"Np
Try it online! and Try it without the c
The nineteenth byte is the c, which affects the conditional Np at the end of the program.
><>, 62 bytes
"Stack Exch"\" - "<
" tahC egna"/r>o<r/
eeteniN ehT"\"etyB htn
Try it without the Nineteenth byte
I've been playing around with ><> this week and this one was kind of a freebie, although it still turned out to be an interesting packing problem that ended up getting quite lucky at the end.
The Nineteenth byte is unsurprisingly the < at the end of the first row. With or without it, we'll execute "Stack Exchange Chat ", pushing that string onto the stack (in reverse order; usually we want to push strings backwards but here it's convenient to start with the prefix so we'll just reverse the stack later instead).
At this point, the program encounters the / at the end of the second row, hitting it from the right and heading down, conveniently going through the space between "Nineteenth" and "Byte", then wrapping around vertically and either heading leftwards on the first or second row. With the <, we execute "The Nineteenth Byte", pushing that string on the stack and then head to the output gadget, and without it we head directly to the output.
The output is done by first reversing the stack with r, and then heading into the bottomless pit of >o< which executes the output instruction o endlessly until the stack is emptied and the program exits via error.
05AB1E, 27 bytes
” -€€¥ŠteenthÄÁ” õs”‚‹ºŠÆÿ
Try it online! and Try it without s
” -€€¥ŠteenthÄÁ” # Compressed string " - The Nineteenth Byte"
õ # push the empty string
(s) # (swap back to the other string)
”‚‹ºŠÆÿ # push compressed string "Stack Exchange Chatÿ"
# where ÿ is replaced by the string on the top of the stack
Scratch 3.0, 10 blocks/160 bytes
define
set[outpuuut v]to[Stack Exchange Chat - The Nineteenth Byte
set[outpuuu v]to[Stack Exchange Chat
if<(outpuuut)>(0)>then
say(outpuuut
else
say(outpuuu
end
This outputs Stack Exchange Chat - The Nineteenth Byte
Because Scratch is a block-based language, it may not seem obvious on how to remove a byte at first. But thankfully, there exists a text format called ScratchBlocks which we seem to allow for scoring. The above ScratchBlocks corresponds to the following real blocks:
Removing the 19th byte of this program gives
define
set[outpuuu v]to[Stack Exchange Chat - The Nineteenth Byte
set[outpuuu v]to[Stack Exchange Chat
if<(outpuuut)>(0)>then
say(outpuuut
else
say(outpuuu
end
This outputs Stack Exchange Chat
Explanation coming soon
SNOBOL4 (CSNOBOL4), 90 bytes
Y =1
X =GT(Y) ' - The Nineteenth Byte'
OUTPUT ='Stack Exchange Chat' X
END
The nineteenth byte here is the 1. SNOBOL treats an empty string as 0, and an empty right-hand assignment as an empty string. So when the byte is removed, the program assigns a value of 0 to Y, and the comparison Y GT (implicit 0) fails, hence X is assigned an empty value as well.
Charcoal, 43 bytes
”↶/➙→G,″ⅉ∕ι↑ι&}yσ”→¿›ⅈ¹⁹«¹”↶0δ⁶b↔Πξ[9⊕|c#ξ“
Try it online! Without the 19th byte (the →): Try it online! Explanation:
”↶/➙→G,″ⅉ∕ι↑ι&}yσ”
Print compressed(!) string "Stack Exchange Chat".
→
Move to the 20th column.
¿›ⅈ¹⁹«
If we are no longer in the 19th column, then:
¹
Print a -.
”↶0δ⁶b↔Πξ[9⊕|c#ξ“
Print compressed string " The Nineteenth Byte".
Retina 0.8.2, 51 bytes
Stack Exchange Chat - The Nineteenth Byte
ht.*
hat
Try it online! Explanation: Tries to insert the whole string, but if the 19th byte (the a) is deleted, then replaces everything after the C with hat.
Husk, 31 bytes
↓0000+¨ḟKȦΞ×ėCȦt¨↑30¨ -ξḞẊNτβ/y
↓0000 Drop 0 (does nothing)
+ Concatenate these strings:
¨ḟKȦΞ×ėCȦt¨ Compressed "Stack Exchange Chat"
↑30 Take 30 characters from...
¨ -ξḞẊNτβ/y Compressed " - The Nineteenth Byte"
The 3 is the 19th byte, so removing it makes ↑0¨ -ξḞẊNτβ/y which is the empty string.
APL (Dyalog Classic), 61 bytes
¯12⌽∊('ge Chat'{⍺ ⍵}' - The Nineteenth Byte'),'Stack Exchan'
¯12⌽∊ ⍝ Rotate right 12
{⍺ ⍵} ⍝ Concatenate
, ⍝ Concatenate
Python, 73 bytes
x,t="hange Chat"," ";print("Stack Exc"+x,bool(t)*"- The Nineteenth Byte")
Sure it could be golfed a bit more... first looking for an alternative to bool
Wolfram Language (Mathematica), 60 bytes
"Stack Exc"~Print~##&["hange Chat"," - The Nineteenth Byte"]
The 19th byte is one of the #s. ## represents a sequence of all arguments, but # represents only the first argument.
Python 2, 65 bytes
b='Stack Excha'
n=88
print b+'nge Chat - The Nineteenth Byte'[:n]
Try all of it
Try it without the 19th byte
Works in Python 3 trivially for 66 bytes
Japt, 36 bytes
The nineteenth byte is the i, if it's removed the two strings are essentially separated by the comma operator instead. The first compressed string is manually unrolled a bit to control the position of the i command to be the nineteenth byte.
` - T” Ná2çh By’`i`Stack ExÖˆge C•t
` - T” Ná2çh By’` // Compressed string " - The Nineteenth Byte", slightly manually decompressed to control the position of the next command.
i // This is the nineteenth byte, prepend to the above string, if removed, effectively becomes the comma operator instead.
`Stack ExÖˆge C•t // Compressed string "Stack Exchange Chat"
Python 2, 66 bytes
s,y='Stack Exch',01
print s+'ange Chat'+' - The Nineteenth Byte'*y
Not really a smart answer. :p
The nineteenth byte here is the 1.
y is 0 or 1 depending on if the nineteenth byte is removed.
thanks to pxeger for -2 bytes
Jelly, 25 24 bytes
“ÆçƲBnƥẈṛⱮ_ỴȷOṘỵḊĊ»»ḣ19$
Without the nineteenth byte
“ÆçƲBnƥẈṛⱮ_ỴȷOṘỵḊĊ»ḣ19$
It works no matter if you index from 0 or 1!
Explanation
“ÆçƲBnƥẈṛⱮ_ỴȷOṘỵḊĊ»»ḣ19$ Main niladic link
“ÆçƲBnƥẈṛⱮ_ỴȷOṘỵḊĊ» "Stack Exchange Chat - The Nineteenth Byte"
» [Calculate the byte-wise maximum with]*
$ (
ḣ19 Get the first 19 characters
$ )
*When indexing from 1, it's actually the first » that is removed, but the result is the same.
Scala 3, 90 bytes
val x="Stack Ex"+a/*/ */+" - The Nineteenth Byte"
def a="change Chat"
@main def m=print(x)
With the nineteenth byte removed:
val x="Stack Ex"+a// */+" - The Nineteenth Byte"
def a="change Chat"
@main def m=print(x)
The syntax highlighting should show what happens. This would be a byte shorter in a language without nested comments, since the space in /*/ */ wouldn't be needed, but I just like Scala :P
A possible solution with a newline that doesn't work because of parsing rules:
val x="Stack E"+a//
+" - The Nineteenth Byte"
def a="xchange Chat"
@main def m=print(x)

