7, 23 characters, 9 bytes
54340045141332401057403
Try it online!
This is a fairly hard challenge in a language that consists entirely of digits, but I managed it…
This is just 9 bytes in 7's encoding. (Strictly speaking, it's 8⅜ bytes (23 × ⅜ − ¼ because the final two trailing 1 bits can be omitted), but for the first time, PPCG's requirement to round up to a whole number of bytes is actually an advantage because it means that the extra trailing 1 bits are necessary and thus not banned by the question.) A reversible hex dump:
00000000: b1c0 2530 b6a0 22f8 1f ..%0.."..
The main challenge of writing this program in 7 was golfing it to under 10 bytes (as writing 7 without using 0
or 1
is pretty hard.) This uses the same structure as the standard "Hello world" program:
54340045141332401057403
5434004514133240105 commands 0-5 append literals to data space
7 start a new section of data space
403 another literal appended to data space
{implicit: eval the last section as commands}
4 swap 1st and 2nd sections with an empty section between
6 reconstruct the commands that would create the 1st section
3 output (+ some other effects we don't care about)
In other words, we start by creating two sections of the data space; we have two literals, each of which pushes a sequence of commands there. The second section (they're pushed stack-style so first push = last pop) is a fairly arbitrary sequence of commands but is pushed using the command sequence 5434004514133240105
(thus producing the data sequence 5434664574733246765
; when discussing 7 in text, I normally use normal font for a command that pushes a literal, and bold for the corresponding resulting literal). The first section is pushed using the command sequence 403
, producing 463
. Then the first section is copied back to the program (an implicit behaviour of 7).
The 463
is now composed of (bold) commands that do something immediately, rather than (non-bold) commands that just push literals. 4
rearranges the sections to get our "string literal" into the first section. Then 0
does the operation that 7 is most known for: taking a section of data space, and reconstructing the command sequence that's most likely to have created it. In the case where the original command sequence was all 0
-5
, this is 100% accurate (unsurprisingly, as those commands purely push data and thus leave obvious evidence of what they did), and so we get our original sequence 5434004514133240105
back. Finally, 3
prints it.
So the remaining thing to look at here is the encoding of the string. This has its own domain-specific language:
5434004514133240105
5 change encoding: 6 bits per character
43 select character set: digits and common symbols
40 '9'
04 space
51 select character set: uppercase letters
4133240105 'B' 'Y' 'T' 'E' 'S'
(There's no "select character set: lowercase letters" in the "digits and common symbols" character set – you have to go via a different character set first – so I needed to use uppercase to golf this short enough to fit underneath the effective 10-byte limit.)
bytes
I suspect the intention is that the count should include the bytes it takes to print the text:bytes
\$\endgroup\$1 bytes
or1 byte
? (keep in mind there are already 41 answers, although I don't think any are affected) \$\endgroup\$bytes
be in any case pattern, e.g.bYtEs
? \$\endgroup\$