Output the Arecibo Message Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The PPCG Site design is on its way - help us make it awesome! Sandbox for Proposed ChallengesUpgoat or Downgoat?Binary Images of Triangle CountsDraw the national flag of FranceBacon's cipher: An Intro to SteganographyDowngoat-ify Animals!Two-Coloring Overlapping CirclesCan you count the number of rectangles?The Lonely IslandsStacked digit staircasesScoring 6,5,4 (AKA Ship, Captain, and Crew)Sub-pixel Zooming
What computer would be fastest for Mathematica Home Edition?
Stop battery usage [Ubuntu 18]
Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?
Active filter with series inductor and resistor - do these exist?
Why is "Captain Marvel" translated as male in Portugal?
How can I make names more distinctive without making them longer?
What was the last x86 CPU that did not have the x87 floating-point unit built in?
The following signatures were invalid: EXPKEYSIG 1397BC53640DB551
Are my PIs rude or am I just being too sensitive?
Need a suitable toxic chemical for a murder plot in my novel
Replacing HDD with SSD; what about non-APFS/APFS?
Unable to start mainnet node docker container
Is it possible to ask for a hotel room without minibar/extra services?
How do I keep my slimes from escaping their pens?
How to retrograde a note sequence in Finale?
Using "nakedly" instead of "with nothing on"
Interesting examples of non-locally compact topological groups
What LEGO pieces have "real-world" functionality?
How does modal jazz use chord progressions?
Is there folklore associating late breastfeeding with low intelligence and/or gullibility?
Was credit for the black hole image misattributed?
Am I ethically obligated to go into work on an off day if the reason is sudden?
Single author papers against my advisor's will?
Why is there no army of Iron-Mans in the MCU?
Output the Arecibo Message
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The PPCG Site design is on its way - help us make it awesome!
Sandbox for Proposed ChallengesUpgoat or Downgoat?Binary Images of Triangle CountsDraw the national flag of FranceBacon's cipher: An Intro to SteganographyDowngoat-ify Animals!Two-Coloring Overlapping CirclesCan you count the number of rectangles?The Lonely IslandsStacked digit staircasesScoring 6,5,4 (AKA Ship, Captain, and Crew)Sub-pixel Zooming
$begingroup$
The Arecibo message is a 1974 interstellar radio message carrying basic information about humanity and Earth sent to globular star cluster M13 in the hope that extraterrestrial intelligence might receive and decipher it... The message consisted of 1,679 binary digits, approximately 210 bytes...
The number 1,679 was chosen because it is a semiprime (the product of two prime numbers), to be arranged rectangularly as 73 rows by 23 columns. The alternative arrangement, 23 rows by 73 columns, produces an unintelligible set of characters (as do all other X/Y formats).
This is the message with color added to highlight its separate parts. The actual binary transmission carried no color information.
Source: Wikipedia
Your task is to output the Arecibo Message in the exact 23x73 arrangement shown in the image. Any of these output formats is acceptable:
- Text, using one character for ones and another for zeros (using the usual rules for row separation)
- A 2D array of two distinct values
- A 23x73 image with two distinct colors
- Aan uninterrupted stream of 1679 items of two distinct values (i.e. any of the above formats, but flat.)
- A 1679-bit integer. Indicate bit and byte order (endianness) in your solution.
For your convenience, here is a copy-pastable version (also an example output in text format):
00000010101010000000000
00101000001010000000100
10001000100010010110010
10101010101010100100100
00000000000000000000000
00000000000011000000000
00000000001101000000000
00000000001101000000000
00000000010101000000000
00000000011111000000000
00000000000000000000000
11000011100011000011000
10000000000000110010000
11010001100011000011010
11111011111011111011111
00000000000000000000000
00010000000000000000010
00000000000000000000000
00001000000000000000001
11111000000000000011111
00000000000000000000000
11000011000011100011000
10000000100000000010000
11010000110001110011010
11111011111011111011111
00000000000000000000000
00010000001100000000010
00000000001100000000000
00001000001100000000001
11111000001100000011111
00000000001100000000000
00100000000100000000100
00010000001100000001000
00001100001100000010000
00000011000100001100000
00000000001100110000000
00000011000100001100000
00001100001100000010000
00010000001000000001000
00100000001100000000100
01000000001100000000100
01000000000100000001000
00100000001000000010000
00010000000000001100000
00001100000000110000000
00100011101011000000000
00100000001000000000000
00100000111110000000000
00100001011101001011011
00000010011100100111111
10111000011100000110111
00000000010100000111011
00100000010100000111111
00100000010100000110000
00100000110110000000000
00000000000000000000000
00111000001000000000000
00111010100010101010101
00111000000000101010100
00000000000000101000000
00000000111110000000000
00000011111111100000000
00001110000000111000000
00011000000000001100000
00110100000000010110000
01100110000000110011000
01000101000001010001000
01000100100010010001000
00000100010100010000000
00000100001000010000000
00000100000000010000000
00000001001010000000000
01111001111101001111000
If your language, for some reason, has a builtin for the Arecibo Message, you may not use that builtin.
Good Luck!
UPDATE: I accepted the 05AB1E answer since it was the first one to be shorter than the original message. Don't let that dissuade you from new solutions.
code-golf kolmogorov-complexity
$endgroup$
|
show 5 more comments
$begingroup$
The Arecibo message is a 1974 interstellar radio message carrying basic information about humanity and Earth sent to globular star cluster M13 in the hope that extraterrestrial intelligence might receive and decipher it... The message consisted of 1,679 binary digits, approximately 210 bytes...
The number 1,679 was chosen because it is a semiprime (the product of two prime numbers), to be arranged rectangularly as 73 rows by 23 columns. The alternative arrangement, 23 rows by 73 columns, produces an unintelligible set of characters (as do all other X/Y formats).
This is the message with color added to highlight its separate parts. The actual binary transmission carried no color information.
Source: Wikipedia
Your task is to output the Arecibo Message in the exact 23x73 arrangement shown in the image. Any of these output formats is acceptable:
- Text, using one character for ones and another for zeros (using the usual rules for row separation)
- A 2D array of two distinct values
- A 23x73 image with two distinct colors
- Aan uninterrupted stream of 1679 items of two distinct values (i.e. any of the above formats, but flat.)
- A 1679-bit integer. Indicate bit and byte order (endianness) in your solution.
For your convenience, here is a copy-pastable version (also an example output in text format):
00000010101010000000000
00101000001010000000100
10001000100010010110010
10101010101010100100100
00000000000000000000000
00000000000011000000000
00000000001101000000000
00000000001101000000000
00000000010101000000000
00000000011111000000000
00000000000000000000000
11000011100011000011000
10000000000000110010000
11010001100011000011010
11111011111011111011111
00000000000000000000000
00010000000000000000010
00000000000000000000000
00001000000000000000001
11111000000000000011111
00000000000000000000000
11000011000011100011000
10000000100000000010000
11010000110001110011010
11111011111011111011111
00000000000000000000000
00010000001100000000010
00000000001100000000000
00001000001100000000001
11111000001100000011111
00000000001100000000000
00100000000100000000100
00010000001100000001000
00001100001100000010000
00000011000100001100000
00000000001100110000000
00000011000100001100000
00001100001100000010000
00010000001000000001000
00100000001100000000100
01000000001100000000100
01000000000100000001000
00100000001000000010000
00010000000000001100000
00001100000000110000000
00100011101011000000000
00100000001000000000000
00100000111110000000000
00100001011101001011011
00000010011100100111111
10111000011100000110111
00000000010100000111011
00100000010100000111111
00100000010100000110000
00100000110110000000000
00000000000000000000000
00111000001000000000000
00111010100010101010101
00111000000000101010100
00000000000000101000000
00000000111110000000000
00000011111111100000000
00001110000000111000000
00011000000000001100000
00110100000000010110000
01100110000000110011000
01000101000001010001000
01000100100010010001000
00000100010100010000000
00000100001000010000000
00000100000000010000000
00000001001010000000000
01111001111101001111000
If your language, for some reason, has a builtin for the Arecibo Message, you may not use that builtin.
Good Luck!
UPDATE: I accepted the 05AB1E answer since it was the first one to be shorter than the original message. Don't let that dissuade you from new solutions.
code-golf kolmogorov-complexity
$endgroup$
9
$begingroup$
If a language has a built in for Arecibo message, I can tell, with all certainty, that I've seen everything in this world c:
$endgroup$
– Luis felipe De jesus Munoz
Apr 9 at 18:04
6
$begingroup$
Mathematica (IIRC) has an image builtin for Lena, so it wouldn't surprise me if it also has an Aricebo message as well.
$endgroup$
– Beefster
Apr 9 at 18:06
$begingroup$
@RobertS. no because there are other valid formats besides text.
$endgroup$
– Beefster
Apr 9 at 18:27
3
$begingroup$
In the spirit of the original format, a flat result/output should be allowed. The whole point of 1679 bits is exactly that the proper number of rows and columns can be inferred from the signal length.
$endgroup$
– Adám
Apr 9 at 19:10
4
$begingroup$
@LuisfelipeDejesusMunoz Mathematica has a builtin to determine goats in a picture, so an Arecibo message builtin wouldn't really surprise me either.. That language is built on builtins of the universe.. >.>
$endgroup$
– Kevin Cruijssen
Apr 10 at 6:47
|
show 5 more comments
$begingroup$
The Arecibo message is a 1974 interstellar radio message carrying basic information about humanity and Earth sent to globular star cluster M13 in the hope that extraterrestrial intelligence might receive and decipher it... The message consisted of 1,679 binary digits, approximately 210 bytes...
The number 1,679 was chosen because it is a semiprime (the product of two prime numbers), to be arranged rectangularly as 73 rows by 23 columns. The alternative arrangement, 23 rows by 73 columns, produces an unintelligible set of characters (as do all other X/Y formats).
This is the message with color added to highlight its separate parts. The actual binary transmission carried no color information.
Source: Wikipedia
Your task is to output the Arecibo Message in the exact 23x73 arrangement shown in the image. Any of these output formats is acceptable:
- Text, using one character for ones and another for zeros (using the usual rules for row separation)
- A 2D array of two distinct values
- A 23x73 image with two distinct colors
- Aan uninterrupted stream of 1679 items of two distinct values (i.e. any of the above formats, but flat.)
- A 1679-bit integer. Indicate bit and byte order (endianness) in your solution.
For your convenience, here is a copy-pastable version (also an example output in text format):
00000010101010000000000
00101000001010000000100
10001000100010010110010
10101010101010100100100
00000000000000000000000
00000000000011000000000
00000000001101000000000
00000000001101000000000
00000000010101000000000
00000000011111000000000
00000000000000000000000
11000011100011000011000
10000000000000110010000
11010001100011000011010
11111011111011111011111
00000000000000000000000
00010000000000000000010
00000000000000000000000
00001000000000000000001
11111000000000000011111
00000000000000000000000
11000011000011100011000
10000000100000000010000
11010000110001110011010
11111011111011111011111
00000000000000000000000
00010000001100000000010
00000000001100000000000
00001000001100000000001
11111000001100000011111
00000000001100000000000
00100000000100000000100
00010000001100000001000
00001100001100000010000
00000011000100001100000
00000000001100110000000
00000011000100001100000
00001100001100000010000
00010000001000000001000
00100000001100000000100
01000000001100000000100
01000000000100000001000
00100000001000000010000
00010000000000001100000
00001100000000110000000
00100011101011000000000
00100000001000000000000
00100000111110000000000
00100001011101001011011
00000010011100100111111
10111000011100000110111
00000000010100000111011
00100000010100000111111
00100000010100000110000
00100000110110000000000
00000000000000000000000
00111000001000000000000
00111010100010101010101
00111000000000101010100
00000000000000101000000
00000000111110000000000
00000011111111100000000
00001110000000111000000
00011000000000001100000
00110100000000010110000
01100110000000110011000
01000101000001010001000
01000100100010010001000
00000100010100010000000
00000100001000010000000
00000100000000010000000
00000001001010000000000
01111001111101001111000
If your language, for some reason, has a builtin for the Arecibo Message, you may not use that builtin.
Good Luck!
UPDATE: I accepted the 05AB1E answer since it was the first one to be shorter than the original message. Don't let that dissuade you from new solutions.
code-golf kolmogorov-complexity
$endgroup$
The Arecibo message is a 1974 interstellar radio message carrying basic information about humanity and Earth sent to globular star cluster M13 in the hope that extraterrestrial intelligence might receive and decipher it... The message consisted of 1,679 binary digits, approximately 210 bytes...
The number 1,679 was chosen because it is a semiprime (the product of two prime numbers), to be arranged rectangularly as 73 rows by 23 columns. The alternative arrangement, 23 rows by 73 columns, produces an unintelligible set of characters (as do all other X/Y formats).
This is the message with color added to highlight its separate parts. The actual binary transmission carried no color information.
Source: Wikipedia
Your task is to output the Arecibo Message in the exact 23x73 arrangement shown in the image. Any of these output formats is acceptable:
- Text, using one character for ones and another for zeros (using the usual rules for row separation)
- A 2D array of two distinct values
- A 23x73 image with two distinct colors
- Aan uninterrupted stream of 1679 items of two distinct values (i.e. any of the above formats, but flat.)
- A 1679-bit integer. Indicate bit and byte order (endianness) in your solution.
For your convenience, here is a copy-pastable version (also an example output in text format):
00000010101010000000000
00101000001010000000100
10001000100010010110010
10101010101010100100100
00000000000000000000000
00000000000011000000000
00000000001101000000000
00000000001101000000000
00000000010101000000000
00000000011111000000000
00000000000000000000000
11000011100011000011000
10000000000000110010000
11010001100011000011010
11111011111011111011111
00000000000000000000000
00010000000000000000010
00000000000000000000000
00001000000000000000001
11111000000000000011111
00000000000000000000000
11000011000011100011000
10000000100000000010000
11010000110001110011010
11111011111011111011111
00000000000000000000000
00010000001100000000010
00000000001100000000000
00001000001100000000001
11111000001100000011111
00000000001100000000000
00100000000100000000100
00010000001100000001000
00001100001100000010000
00000011000100001100000
00000000001100110000000
00000011000100001100000
00001100001100000010000
00010000001000000001000
00100000001100000000100
01000000001100000000100
01000000000100000001000
00100000001000000010000
00010000000000001100000
00001100000000110000000
00100011101011000000000
00100000001000000000000
00100000111110000000000
00100001011101001011011
00000010011100100111111
10111000011100000110111
00000000010100000111011
00100000010100000111111
00100000010100000110000
00100000110110000000000
00000000000000000000000
00111000001000000000000
00111010100010101010101
00111000000000101010100
00000000000000101000000
00000000111110000000000
00000011111111100000000
00001110000000111000000
00011000000000001100000
00110100000000010110000
01100110000000110011000
01000101000001010001000
01000100100010010001000
00000100010100010000000
00000100001000010000000
00000100000000010000000
00000001001010000000000
01111001111101001111000
If your language, for some reason, has a builtin for the Arecibo Message, you may not use that builtin.
Good Luck!
UPDATE: I accepted the 05AB1E answer since it was the first one to be shorter than the original message. Don't let that dissuade you from new solutions.
code-golf kolmogorov-complexity
code-golf kolmogorov-complexity
edited Apr 11 at 17:45
Beefster
asked Apr 9 at 18:01
BeefsterBeefster
2,7601346
2,7601346
9
$begingroup$
If a language has a built in for Arecibo message, I can tell, with all certainty, that I've seen everything in this world c:
$endgroup$
– Luis felipe De jesus Munoz
Apr 9 at 18:04
6
$begingroup$
Mathematica (IIRC) has an image builtin for Lena, so it wouldn't surprise me if it also has an Aricebo message as well.
$endgroup$
– Beefster
Apr 9 at 18:06
$begingroup$
@RobertS. no because there are other valid formats besides text.
$endgroup$
– Beefster
Apr 9 at 18:27
3
$begingroup$
In the spirit of the original format, a flat result/output should be allowed. The whole point of 1679 bits is exactly that the proper number of rows and columns can be inferred from the signal length.
$endgroup$
– Adám
Apr 9 at 19:10
4
$begingroup$
@LuisfelipeDejesusMunoz Mathematica has a builtin to determine goats in a picture, so an Arecibo message builtin wouldn't really surprise me either.. That language is built on builtins of the universe.. >.>
$endgroup$
– Kevin Cruijssen
Apr 10 at 6:47
|
show 5 more comments
9
$begingroup$
If a language has a built in for Arecibo message, I can tell, with all certainty, that I've seen everything in this world c:
$endgroup$
– Luis felipe De jesus Munoz
Apr 9 at 18:04
6
$begingroup$
Mathematica (IIRC) has an image builtin for Lena, so it wouldn't surprise me if it also has an Aricebo message as well.
$endgroup$
– Beefster
Apr 9 at 18:06
$begingroup$
@RobertS. no because there are other valid formats besides text.
$endgroup$
– Beefster
Apr 9 at 18:27
3
$begingroup$
In the spirit of the original format, a flat result/output should be allowed. The whole point of 1679 bits is exactly that the proper number of rows and columns can be inferred from the signal length.
$endgroup$
– Adám
Apr 9 at 19:10
4
$begingroup$
@LuisfelipeDejesusMunoz Mathematica has a builtin to determine goats in a picture, so an Arecibo message builtin wouldn't really surprise me either.. That language is built on builtins of the universe.. >.>
$endgroup$
– Kevin Cruijssen
Apr 10 at 6:47
9
9
$begingroup$
If a language has a built in for Arecibo message, I can tell, with all certainty, that I've seen everything in this world c:
$endgroup$
– Luis felipe De jesus Munoz
Apr 9 at 18:04
$begingroup$
If a language has a built in for Arecibo message, I can tell, with all certainty, that I've seen everything in this world c:
$endgroup$
– Luis felipe De jesus Munoz
Apr 9 at 18:04
6
6
$begingroup$
Mathematica (IIRC) has an image builtin for Lena, so it wouldn't surprise me if it also has an Aricebo message as well.
$endgroup$
– Beefster
Apr 9 at 18:06
$begingroup$
Mathematica (IIRC) has an image builtin for Lena, so it wouldn't surprise me if it also has an Aricebo message as well.
$endgroup$
– Beefster
Apr 9 at 18:06
$begingroup$
@RobertS. no because there are other valid formats besides text.
$endgroup$
– Beefster
Apr 9 at 18:27
$begingroup$
@RobertS. no because there are other valid formats besides text.
$endgroup$
– Beefster
Apr 9 at 18:27
3
3
$begingroup$
In the spirit of the original format, a flat result/output should be allowed. The whole point of 1679 bits is exactly that the proper number of rows and columns can be inferred from the signal length.
$endgroup$
– Adám
Apr 9 at 19:10
$begingroup$
In the spirit of the original format, a flat result/output should be allowed. The whole point of 1679 bits is exactly that the proper number of rows and columns can be inferred from the signal length.
$endgroup$
– Adám
Apr 9 at 19:10
4
4
$begingroup$
@LuisfelipeDejesusMunoz Mathematica has a builtin to determine goats in a picture, so an Arecibo message builtin wouldn't really surprise me either.. That language is built on builtins of the universe.. >.>
$endgroup$
– Kevin Cruijssen
Apr 10 at 6:47
$begingroup$
@LuisfelipeDejesusMunoz Mathematica has a builtin to determine goats in a picture, so an Arecibo message builtin wouldn't really surprise me either.. That language is built on builtins of the universe.. >.>
$endgroup$
– Kevin Cruijssen
Apr 10 at 6:47
|
show 5 more comments
21 Answers
21
active
oldest
votes
$begingroup$
05AB1E, 215 210 200 bytes
Saved 15 bytes thanks to Magic Octopus Urn
•cOž¤4é57ñΛÖ₃BαöĀíL½₅üBdoÙRθLγ¨G×Tćú$G(˜ƒ¦!€R»SDrµCnJ†d∊ζ·<8‡T@|‹ï=BζćósxGÙÎ$¿o₁5/ÔŸÇBûXé-”a::Ž]°∊y;ζ]MÜβ‘иL”βüÃÇíäc€÷›ÎU=¨иaŸdY`»¾ÚUβ:ô©¦β†₅DGŠβ3Jêθ,äá!ícqšVÖ›lÈΣ¯pε €êʃDpÙ/¬Žλ8:ãÿ3=€.Þć•3BY¾4×:
Try it online!
or with Additional formatting
Base-255 encoded trinary string with occurrences of 0000
replaced by 2
.
$endgroup$
$begingroup$
@MagicOctopusUrn: Thanks! That makes it 210 even :)
$endgroup$
– Emigna
Apr 10 at 14:15
$begingroup$
It's actually even better if you replace0000
with2
by 9 more bytes. - pastebin.com/aZ6tHxjx for 201
$endgroup$
– Magic Octopus Urn
Apr 10 at 14:19
$begingroup$
@MagicOctopusUrn: Yes, I found that as well and was just about to post it :)
$endgroup$
– Emigna
Apr 10 at 14:24
1
$begingroup$
Cool! Since the Arecibo messages is 210 bytes (23 * 73 / 8 = 209.875), your solution (currently at 200 bytes) is shorter than the message itself!
$endgroup$
– J-L
Apr 11 at 16:51
$begingroup$
I went ahead and made this the accepted answer since it was the first one to be shorter than the message itself.
$endgroup$
– Beefster
Apr 11 at 17:42
add a comment |
$begingroup$
Java, 688 678 590 379 361 bytes
Returns a string.
n->new java.math.BigInteger("in95mzupnpa2r0khpoepyql6ioqyn413avucdtfay6indx4wh9dehe3sn18klobtf4z9g9q17umqmwpegr2khb5eqinn7azl4jpfp2a8eui0xfrx5qwrou6gd65jh4ge3ls14k5lu7qrvmg6942ms29u5rb8fa6yrdhfoh5zoi9bdi7uh5ig0u0ff9kounth8sh357x7qox4m3oqviqsbrvakonbka4ahp21bgzi5v1akzzuqoncszhpabbru9q1uo2g11zr73iuyiqr5ikr69zn7cdv7e1lhd6ese9",36).toString(3).replace("2","0000")
-10 bytes by returning the raw stream (old answer)
-88 bytes by using base 10 numerics (thanks @ceilingcat!)
-211 bytes (I knew it could be golfed!) by using a base-36 encoded BigInteger (thanks @JollyJoker!)
-18 bytes by using a different encoded integer (thanks again @JollyJoker)
Try it online!
Explanation:
n->new java.math.BigInteger("base36 string",36) // Decode the base-36 integer.
.toString(3) // Re-encode as ternary
.replace("2","0000") // Replace 2 with "0000"
// Implicit return
$endgroup$
1
$begingroup$
Comments are not for extended discussion; this conversation has been moved to chat.
$endgroup$
– Adam Lear♦
Apr 11 at 22:37
add a comment |
$begingroup$
Jelly, 213 bytes
“H²ɓ¶Ṡḷ€ẹ]ƒf*ḳḢ&ƁṇOḥḄṫwỊ+oLạʋߢH9¢¹÷ỴɗÇ⁶ƲƙæḊẋ3³=1!VƇƁ'D⁺3Ỵɱ©⁵%fȯez#ƈjƒżṆo.ZF⁶ċṢ⁶ọṛb9Ȯƒd?ƁUĠt4ẇ,ḞġƒµƭfʠƁP§÷øȤŻPɲẋ(¢ß¢(⁽3¶ṙėɗy@ṁYȮL~e⁷ƤĊ§nỊṅµṠ°@7ẠB>Ġ⁻İuy¡½:esOpḢt}qS©HÞṬĖṛṇḣ9÷;ESḢ,Ẉ^ṙpƲ©tṃwçnẒṆ¡⁻Jıƒị£-&Ɱ*ẋʂżoȯÑḢɼ’
Try it online!
I played around with Huffman coding, but the improvements in data size were outweighed by the extra code. As such, this is simply a base-250 encoded version of the desired output. Output consists of an integer that when decoded as bijective base 2 will yield the 1D list of 1s and 2s. Thanks @Emigna for pointing out the change in rules.
Try it online - with further decoding to demonstrate output!
If a more conventional binary encoding is preferred, here is one that encodes an integer representation of the inverted binary message. The most significant bit of the integer represents the beginning of the message.
$endgroup$
add a comment |
$begingroup$
Brainfuck, 2360 2008 1938 bytes
-[>+<-----]>---......+.-.+.-.+.-.+.-............+.-.+.-.....+.-.+.-.......+.-.<++++[->.+.-..<]>+.-.+..-.<+++++++++[->.+.-<]>..+.-..+.-<++++++[->......<]>.+.<++[->.-...................+..-.+<]>.-..................+.-.+.-.+.-..................+.....-<++++++++[->....<]>+..-....+...-...+..-....+..-...+.-.............+..-..+.-....+..-.+.-...+..-...+..-....+..-.+<++++[->.-.+....<]>.-<+++++[->.....<]>.+.-.................+.-............................+.-.................+......-.............+.....-.......................+..-....+..-....+...-...+..-...+.-.......+.-.........+.-....+..-.+.-....+..-...+...-..+..-.+.-.+.....-.+.....-.+.....-.+.....-..........................+.-......+..-.........+.-...........+..-...............+.-.....+..-..........+......-.....+..-......+.....-..........+..-.....<+++[->........+.-<]>.....+.-......+..-.......+.-.......+..-....+..-......+.-..........+..-...+.-....+..-...............+..-..+..-.............+..-...+.-....+..-.........+..-....+..-......+.-.......+.-......+.-........+.-.....+.-<++[->.......+..-........+.-...+.-.<]>........+.-.......+.-<++++[->.....+.-..<]>..........+..-.........+..-........+..-.........+.-...+...-.+.-.+..-...........+.-.......+.-..............+.-.....+.....-............+.-....+.-.+...-.+.-..+.-.+..-.+..-......+.-..+...-..+.-..+.......-.+...-....+...-.....+..-.+...-.........+.-.+.-.....+...-.+..-..+.-......+.-.+.-.....+......-..+.-......+.-.+.-.....+..-......+.-.....+..-.+..-<+++++++[->.....<]>+...-.....+.-..............+...-.+.-.+.-..<++++++[->.+.-<]>..+...-.........+.-.+.-.+.-.+.-................+.-.+.-..............+.....-................+.........-............+...-.......+...-.<++[->........+..-...<]>....+..-.+.-.........+.-.+..-<++[->.....+..-..+..-..<]>..+.-...+.-.+.-.....+.-.+.-...+.-..<+++[->..+.-...+.-<]>........+.-...+.-.+.-...+.-............+.-....+.-.<++[->...+.-.........<]>+.-..............+.-..+.-.+.-...........+....-..+.....-.+.-..+....-...
Try it online!
I will probably golf this even further soon.
$endgroup$
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 366 332 329 319 bytes
int i;foreach(var g in"*ЀʂЄ࢈ҲપԤ␀␀␀ȀȀȀ␀␀సؘࠀƐഘؚ྾ߟ␀␀Ā␀␀ྀ␀␀రܘࠈഌΚ྾ߟ␀␀ă␀ྃ␀ȁăÃ1`ƀ1`ÃĂȃЃЁȂĀ`ÀƀȺȂ␀ȏЀȗɛ'Ŀஇ7;ȅ?ȅ0ȍЀ␀␀␀ΨՕŔ␀ŀЀ?܀àǀƀ`̀°٠Ƙѐʈш҈EB@Ѐޟɸ")Write(Convert.ToString(g,2).PadLeft(12-i++%2,'0'));
Replace all instances of ␀
with to test.
Try it online!
C# (Visual C# Interactive Compiler), 305 bytes, 210 chars
_=>"*ЀʂЄ࢈ҲપԤ␀␀␀ȀȀȀ␀␀సؘࠀƐഘؚ྾ߟ␀␀Ā␀␀ྀ␀␀రܘࠈഌΚ྾ߟ␀␀ă␀ྃ␀ȁăÃ1`ƀ1`ÃĂȃЃЁȂĀ`ÀƀȺȂ␀ȏЀȗɛ'Ŀஇ7;ȅ?ȅ0ȍЀ␀␀␀ΨՕŔ␀ŀЀ?܀àǀƀ`̀°٠Ƙѐʈш҈EB@Ѐޟɸ".Select((g,i)=>Convert.ToString(g,2).PadLeft(12-i%2,'0'))
Same with above, replace with ␀
with to test. Output as
IEnumerable<string>
.
Try it online!(Courtesy of Jo King)
$endgroup$
$begingroup$
TIO link with NUL bytes
$endgroup$
– Jo King
Apr 10 at 6:47
$begingroup$
I believe the++
in12-i++%2
is a nop (at least, it worked for me when I removed it)
$endgroup$
– someone
Apr 10 at 12:24
$begingroup$
@someone They are a copy-paste from the old answer I forgot to remove
$endgroup$
– Embodiment of Ignorance
Apr 10 at 14:56
add a comment |
$begingroup$
Deadfish~, 1115 bytes
ooooooiodoiodoiodoiodoicdooiodoiodoooooiodoiodoooooooiodooicdiodoooiodoooiodoooiodooiodoioodooiodoicdiodoiodoiodoiodoiodoiodoiodoiodooiodooiodooicdoooooicdoooioodoooooooooicdoioodoiodoooooooooicdoioodoiodoooooooooicdoooooooooiodoiodoiodoooooooooicdoooooooooiooooodoooooooooicdoooooicdioodooooiooodoooioodooooioodoooicdiodooooioodooiodooooicdioodoiodoooioodoooioodooooioodoiodoicdiooooodoiooooodoiooooodoiooooodicdoooooicdoooiodooooooooiodoicdoooooicdooooiodooooooooiodicdiooooodooooiooooodicdoooooicdioodooooioodooooiooodoooioodoooicdiodoooooooiodoooooooooiodooooicdioodoiodooooioodoooiooodooioodoiodoicdiooooodoiooooodoiooooodoiooooodicdoooooicdoooiodooooooioodoooooooooiodoicdoioodooicdooooiodoooooioodoiodicdiooooodoooooioodooooooiooooodicdoioodooicdooiodooooooooiodooooooooiodooicdoooiodooooooioodoooooooiodoooicdooooioodooooioodooooooiodooooicdooooooioodoooiodooooioodoooooicdoioodooioodoooooooicdooooooioodoooiodooooioodooooo
Try it online!
If someone has the patience to golf this further, I salute you ahead of time. :P
$endgroup$
add a comment |
$begingroup$
Perl 6, 368 bytes
.say for :36('FJXOE0PDDNF5Y5EHGB8M9SWMXQOXIKIT9F6ZKWWDEACHCBGXL1N2H60CN0CJ4EMKF7D6MODSKYJVNR4SFTDR6NSM421LQ67B6MWF0G5BQATFOJJJBQ0UFQM64T0MWSQN41C4S5D1QR5KJM2L9UTYMMKUBBQWY45YCMRGO8ZRGTQH7LXMZBUASLCTKX30IH0AYKYEPHO8HFHX8GAY5WM38YOSUX0HABYSH2PPBLRDRZIN5ANAQ3V8PLOZ6EHC0UI95EVJVYD1820T6J14HGX85NWFQET2NWOMSNUT0JW4LHMY90X094TEE9KXJXSNN6YPERFQW').base(2).substr(1).comb(23)
Try it online!
The long string is the message as a single base-36 number (with a single prefixed 1 bit to preserve the leading zeroes) which is then converted back to binary and printed 23 bits at a time.
$endgroup$
$begingroup$
You can use>>.say
and&S/.//
to save bytes. Have you thought about using a different base instead?
$endgroup$
– Jo King
Apr 9 at 22:08
$begingroup$
Yes, I tried using base 65536/Unicode, but the message runs into some forbidden surrogate codepoints. I was able to avoid that by adding a fixed offset to each codepoint, but astonishingly, some of the generated strings crashed Emacs a few times. Resolving the issues started taking more time than I could afford to commit. I'll probably revisit the problem later.
$endgroup$
– Sean
Apr 9 at 22:36
$begingroup$
There's no point going into multiple byte characters, since that increases your byte count. 289 bytes by implementing my tips from above and using base 122 (to avoid carriage returns)
$endgroup$
– Jo King
Apr 10 at 0:58
add a comment |
$begingroup$
Wolfram Language (Mathematica), 383 bytes
StringPartition[Uncompress@"1:eJylVNsRwjAM44s92KBaBTZgAUZhZXqtHUuOWrgjfSRRHFlO4tyer/vjfb1clq0gHirZLRjby986hppcT5p+L3BmgJ3t4Ul4GsNyG++7YbaXLh0ZTPhXa4Sn+X/s9Qfk3Hx2cOaSIuNYaVu5laschvgzSqAjHeZBhilKgKBDEhw0upJRg+HOK4MyNC29sfbc3RV0VPDqeLiRTsG1ulExq1IitpunOa7asnYM9siDZ6eidUCkEzBOUbCkGIig4aTyUGBYWAX6W6aXIWGGI/HlhmsqzSU0QTZjkMVpaX5sBsm1OGKVg1qdjKP0EdyqZBRLhukn8DLBQav6kccgz8OKfgBzjj6Z",23]
Try it online!
$endgroup$
add a comment |
$begingroup$
Node.js, 333 bytes
Returns a binary string of 1,679 characters.
_=>Buffer(")SI)=.);1K?>>>2333A3,93/I3>3)g33)AEAAI)5JQZJTddda3)*3*33+3,e)*e3)//0/1+)1C/7Cgggg3395)9)A3IY)h*IH),39+)995*)AA-)59Y)*O3Z,)//*)91**)A*-)Y+1)I11+)I1)/)5)Y*0?)+)I)-0Y)1@;_*7<gaE/a)Q7[*9HM+IY16I33)a1)*^.><I+S3.38I)*hY)7)a)Y)A,9*A5Y/A:9=9K:1I-=9)19I)9*329)GH<").map(x=>s+=(x-51&&x-41).toString(2).padStart(x-51?6:12,0),s='')&&s
Try it online! (with formatted output)
JavaScript (ES8), 413 bytes
Returns a binary string of 1,679 characters.
_=>atob('AsKoAFBQEiIlwpVVUk!!ABwo!DQ!Gg!V!Aw7g!!GHGHCi!yGjHChsK+w7vDr8K!!Q!Q!!g!/DgAHDs!AGGHDhiAgCGhjwprDu8Ovwr4!ABAw4AQAcK!MKDAD8GB8OAD!QCAQQMBAYYEAMQwABwpgAMQwBwoYEBAgEEBgEQDAIwoAgIMKAwoDCgMKABgDDgDAEdcKACAgAEHwAIXTCtgTDpMO+w6HDgcK4AsKDwrIFB8OkCgwINg!!A4IAB1FVTDoArCo!U!/CgAB/w4ADwoDDoAwAYDQBYMOMBmEUFEIkSMKARR!woQgAQB!MKUAHnDtA'.split`!`.join`AA`).replace(/[sS]/g,c=>c.charCodeAt().toString(2).padStart(8,0))
Try it online! (with formatted output)
$endgroup$
add a comment |
$begingroup$
Bubblegum, 275 236 bytes
00000000: e006 8e00 e45d 0018 6988 6507 a228 f86f .....]..i.e..(.o
00000010: f042 c62f d4d7 b99e 38bc 56c4 52e8 2630 .B./....8.V.R.&0
00000020: 8aaa 7252 d47d 5ef4 c96a 511f 6842 423f ..rR.}^..jQ.hBB?
00000030: 4532 ca9f 22d3 1633 e0c4 665a d5dc 4e68 E2.."..3..fZ..Nh
00000040: 7b09 76ae 3c7e f9d4 fa4a 05e0 4163 c580
$begingroup$
MathGolf, 223 220 bytes
'06*"x·<×J× Ç×►B×ê"@$↕!◙è0♥f░×→0×♠p└☺α?×└•×◙×P♣p¬è:×►∟××××←♦♠♣≥â☻┘A☺▄αp⌂r☻[║►×>◘×♦♦└:☻↑`×♥@@@@►►@♦↑ ☻♀◘☻♦☻☻├×å↑×╠×Ç!♠ 0♀◘↑◘☻♦◘×♠α♥â▼ÇA×└×◘` ×××▀≈═14♦►►π0♀××°×α•×►×××☻×◘××└≈}_├↑♪↓×─0♫♥×××|××*××♪×Ç♠×└×××× ⌐¬╩↕◄○((×T☺"$à+
Try it online!
Explanation
'0 push single character "0"
6* repeat 6 times
"..." push the magic string
$ convert to ordinal
à convert to binary string
+ pop a, b : push(a+b) (add the 6 zeroes)
below is the footer
L/ divide into groups of 23 characters
n join array with newlines into string
$endgroup$
$begingroup$
You can move theL/n
to the footer, so it's actually 220 bytes. Can more bytes be saved by porting the 05AB1E / Java answers (using this compressed integer, convert it to base-3, and replace all2
s with0000
s)?
$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen nice catch! I wish I had more string replacement functions, but that's not part of MathGolf right now.
$endgroup$
– maxb
2 days ago
$begingroup$
How about a map per digit, which maps2
to♫░╞
? EDIT: Never mind. I see you don't have a Base Conversion builtin (except for binary/hexadecimal) to convert to base-3?
$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen I have thought a bit on how I should change the base conversion. I certainly don't need one command for converting binary string to decimal, and another for converting a binary array to decimal. That way, I can fit another base conversion command in (and the idea has always been to have general base conversion in the language).
$endgroup$
– maxb
11 hours ago
add a comment |
$begingroup$
Python 2, 336 bytes
print bin(int('gVQAKCgJERLKqqkgAAAAAMAABoAADQAAKgAAfAAAAAMOMMQAGQ0Yw19998AAAAgAAgAAABAAB+AA+AAADDDjEBAENDHNffffAAAAIGAIAMAAQYAfgwPgBgAIBAIIGAgMMCAGIYAAzAAYhgDDAgIEAggMAiAYBEAQEEBAQEADAGAYAjrABAQACD4AELpbAnJ/cODcAUHZAoPyBQYEGwAAAAAcEAA6iqpwBVAACgAHwAA/4AHAcAYAMBoAsGYDMIoKIRIkQCKIAEIQAIAgAEoAPPp4'.decode('base64').encode('hex'),16))[3:]
Try it online!
Prints a string of bytes
$endgroup$
add a comment |
$begingroup$
Bash, 702 697 bytes
xxd -r -p<<X|xz -dc
fd377a585a000004e6d6b4460200210116000000742fe5a3e006d7010c5d
0018698865079cf6752c9e9a501a87a798b4844f9fcfdaaf87733b9d8239
48c816d860a938767f6cb81299f3e8a638effe3068c0e096a8949c81d706
7dff3ec44e5df185b3a48e5b5857724386e8c37cfbd5c856b12614ee78ec
c41df4db3aea71fd3a8fa474905609f78eb3fd66e246557965e4ab6dfd67
efbd9202f542ded9cf98a6401ee2d23afb2f544bd2442c6f428fd612397c
f2c6ec50847ddccc5832185e487712e5a7676b97058d7e485d5a3536166a
44ab3c689c93073cdda73b5306a83c4cd268e79db238bfa2d08ac912a578
75020bc7828342d5a62ce367aff7fd89290336128d119fa4272da2b2a79f
5973c71935af054f2d91c1bd3ea4847a3502d6dc8c975114dacf8a4de600
622d80986dbb0cd00001a802d80d00001b16e2a7b1c467fb020000000004
595a
X
Try it online!
$endgroup$
add a comment |
$begingroup$
Ruby, 362 bytes
puts"5r0afnfm8wyke8tfy1pwt7xnuaxyh3wodfp7bhsdufyw0xbdp1pumrz2xir652tuc0ss9oec8yad9vefivd66j126wybhefgk2lv38uqqiur11u26q275jk3h2ucithd59awpaenqpqi1pszh52179zw0ddqtbrvo6kyrrgv8c34pqrp83j8estjp63v29t4hqp9yg2hhzjlq1e9zqx6gh20n9lsttimz3nbq060ritrphxaru7quwmv3oujhd9xjddpbacq4bnpf270znhgto59yn0980itylf95pxw9x7rvkvi7mfql1sx46puo8rg4dq0".to_i(36).to_s(2).rjust(1679,?0)
Integer written in base 36. There's surely a more efficient way to compress the integer, e.g. with zlib
or base64
.
Try it online!
$endgroup$
add a comment |
$begingroup$
[C++ (VC++)(but tested with gcc as well)], 585 bytes
#define l(x,y)for(int x=0;x<y;x++)
void f()const char*a="02A800505012Y595Y240U180YD0Y1A0Y540YF80V61C618800321A3186BEFBEF80X10Y40W20YFC001F0X1861C620200868639AFBEFBE0W40C0100180Z83003F0607C00C001008041030101860400C430Z19800310C018604040804101804403008802020808080800600C030047580080800107C002174B604E4FEE1C1B80283B20507E40A0C08360U3820Z751554E00AA0Z140ZF80Z7FC00380E00C0060340160CC06611414422448804510Z8420010040Z940079F4F0";int x=1679;l(i,365)int d=a[i],c=0;d-=(d>47&d<58)?48:((d>64&d<71)?55:0);if(d>70&d<91)c=91-d,d=a[i-1];for(c;c>=0;c--)l(j,4)if(x--)cout<<(int)((d&(8>>j))>0);
Try it online!
ungolfed Version (lacks the break after the 1679th element though and goes until the 1680th):
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
const char arecibo[]="02A800505012Y595Y240U180YD0Y1A0Y540YF80V61C618800321A3186BEFBEF80X10Y40W20YFC001F0X1861C620200868639AFBEFBE0W40C0100180Z83003F0607C00C001008041030101860400C430Z19800310C018604040804101804403008802020808080800600C030047580080800107C002174B604E4FEE1C1B80283B20507E40A0C08360U3820Z751554E00AA0Z140ZF80Z7FC00380E00C0060340160CC06611414422448804510Z8420010040Z940079F4F0";
int i = 0,j;
while (i<sizeof(arecibo)-1)
char digit = arecibo[i];
int count=0;
if (digit >= '0' & digit <= '9')
digit -= '0';
else if (digit>='A'& digit<='F')
digit -= 'A'-10;
else if (digit > 'F'&digit<='Z')
//digit does not contain any valid hex digit in this case
count = 'Z' - digit+1; //digit = Z means repeat 2 more times...
digit = arecibo[i - 1];
for (count; count >= 0; count--)
for (j = 0; j<4; j++)
cout << (int)(((digit)&(8 >> j))>0);
i++;
return 0;
as an Explanation: i concatenated the 73 lines of sample output given to one long line.
i encoded them in hexadecimal where the bit order is msbfirst (using this program https://github.com/Marc-Bender/longBinaryStreamToHex/releases/download/addedErrorCode-4/longBinaryStreamToHex.exe)
i shortened the Output of that by about 70 hexadecimal Digits by using the letters 'G'-'Z' as a sign to repeat the last Digit for a certain amount of times (Z = 2more times, Y = 3more times …)
the rest should be relatively self explainatory for Code-Golfers. abusing the preprocessor to shorten loops, abusing the ,
Operator and the like.
Output Format is uninterrupted stream of 1679 0/1-values.
$endgroup$
$begingroup$
before anybody asks the const is for compatibility with VC++ (what the main development work was done with)
$endgroup$
– der bender
Apr 10 at 21:41
$begingroup$
@ceilingcat i think you can even short that more by pitting your include in the header section...
$endgroup$
– der bender
2 days ago
$begingroup$
557 bytes
$endgroup$
– ceilingcat
22 hours ago
add a comment |
$begingroup$
Perl 6, 348 bytes
"000000"~:36<5r0afnfm8wyke8tfy1pwt7xnuaxyh3wodfp7bhsdufyw0xbdp1pumrz2xir652tuc0ss9oec8yad9vefivd66j126wybhefgk2lv38uqqiur11u26q275jk3h2ucithd59awpaenqpqi1pszh52179zw0ddqtbrvo6kyrrgv8c34pqrp83j8estjp63v29t4hqp9yg2hhzjlq1e9zqx6gh20n9lsttimz3nbq060ritrphxaru7quwmv3oujhd9xjddpbacq4bnpf270znhgto59yn0980itylf95pxw9x7rvkvi7mfql1sx46puo8rg4dq0>.base(2)
Based on Benjamin Urquhart's Java solution.
Uses a straight stream of 0 and 1 characters. The link below has some code to prettify the output.
Try it online!
$endgroup$
add a comment |
$begingroup$
Piet, 1763 codels
Outputs a stream of 0s and 1s (no line breaks).
Codel size 1:
Codel size 4, for easier viewing:
Explanation
- First, push a sentinel value of -1 onto the stack.
- Then push the Arecibo message, in reverse order (because it's a stack), using run-length encoding.
- Finally, alternate between two loops, one printing zeroes and the other printing ones.
- The loop counter is the current stack value, decremented until it hits zero, at which point it is discarded and we switch to the other loop.
- Between the zeroes-loop and the ones-loop, check for the sentinel value, exiting if it is found.
Notes
The program follows a spiral path, clockwise from top left into the centre. The scattered black blocks that roughly follow the diagonals are the flow control. Here's the trace from NPiet.
I've been working on this since the day this challenge went up, but it took a little bit of time to get the message "written" into the picture! I wrote the final loops and the sentinel value first, and then built up the message from the centre outwards. (Since Piet always starts execution from the top left, I expected to have to shuffle and rotate the image around to avoid excess whitespace, but it fit perfectly!)
Fun fact: Run-length encoding in Piet doesn't (by itself) save any space. It takes n codels of one colour to push the value n onto the stack, or n codels of different colours to push that many 1s onto the stack. So it's the same number of codels either way. But the bigger numbers that RLE gives you mean you can use arithmetic tricks (e.g. instead of pushing 9, you can push 3, duplicate, and multiply) to reduce the number of codels, and funny-shaped blocks to fill in available whitespace.
I wasn't sure about how to count score for Piet entries. I found some that seem to count all codels, and others that explicitly only count those actively used. I just counted them all; ignoring white codels (even those that the program never moves through) seems akin to ignoring whitespace in a more typical programming language.
Oh, and I've just now (two hours after posting) realised that I wasted the last bit of time working on this. I wanted to trim off the almost-completely-white last row and column, so I shuffled things around... including the black flow-control blocks. But the edges of the image work the same as black! If I'd just remembered that, I wouldn't have needed to spend so much time puzzling over the intricacies of DPs and CCs...
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "200"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f182924%2foutput-the-arecibo-message%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
21 Answers
21
active
oldest
votes
21 Answers
21
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
05AB1E, 215 210 200 bytes
Saved 15 bytes thanks to Magic Octopus Urn
•cOž¤4é57ñΛÖ₃BαöĀíL½₅üBdoÙRθLγ¨G×Tćú$G(˜ƒ¦!€R»SDrµCnJ†d∊ζ·<8‡T@|‹ï=BζćósxGÙÎ$¿o₁5/ÔŸÇBûXé-”a::Ž]°∊y;ζ]MÜβ‘иL”βüÃÇíäc€÷›ÎU=¨иaŸdY`»¾ÚUβ:ô©¦β†₅DGŠβ3Jêθ,äá!ícqšVÖ›lÈΣ¯pε €êʃDpÙ/¬Žλ8:ãÿ3=€.Þć•3BY¾4×:
Try it online!
or with Additional formatting
Base-255 encoded trinary string with occurrences of 0000
replaced by 2
.
$endgroup$
$begingroup$
@MagicOctopusUrn: Thanks! That makes it 210 even :)
$endgroup$
– Emigna
Apr 10 at 14:15
$begingroup$
It's actually even better if you replace0000
with2
by 9 more bytes. - pastebin.com/aZ6tHxjx for 201
$endgroup$
– Magic Octopus Urn
Apr 10 at 14:19
$begingroup$
@MagicOctopusUrn: Yes, I found that as well and was just about to post it :)
$endgroup$
– Emigna
Apr 10 at 14:24
1
$begingroup$
Cool! Since the Arecibo messages is 210 bytes (23 * 73 / 8 = 209.875), your solution (currently at 200 bytes) is shorter than the message itself!
$endgroup$
– J-L
Apr 11 at 16:51
$begingroup$
I went ahead and made this the accepted answer since it was the first one to be shorter than the message itself.
$endgroup$
– Beefster
Apr 11 at 17:42
add a comment |
$begingroup$
05AB1E, 215 210 200 bytes
Saved 15 bytes thanks to Magic Octopus Urn
•cOž¤4é57ñΛÖ₃BαöĀíL½₅üBdoÙRθLγ¨G×Tćú$G(˜ƒ¦!€R»SDrµCnJ†d∊ζ·<8‡T@|‹ï=BζćósxGÙÎ$¿o₁5/ÔŸÇBûXé-”a::Ž]°∊y;ζ]MÜβ‘иL”βüÃÇíäc€÷›ÎU=¨иaŸdY`»¾ÚUβ:ô©¦β†₅DGŠβ3Jêθ,äá!ícqšVÖ›lÈΣ¯pε €êʃDpÙ/¬Žλ8:ãÿ3=€.Þć•3BY¾4×:
Try it online!
or with Additional formatting
Base-255 encoded trinary string with occurrences of 0000
replaced by 2
.
$endgroup$
$begingroup$
@MagicOctopusUrn: Thanks! That makes it 210 even :)
$endgroup$
– Emigna
Apr 10 at 14:15
$begingroup$
It's actually even better if you replace0000
with2
by 9 more bytes. - pastebin.com/aZ6tHxjx for 201
$endgroup$
– Magic Octopus Urn
Apr 10 at 14:19
$begingroup$
@MagicOctopusUrn: Yes, I found that as well and was just about to post it :)
$endgroup$
– Emigna
Apr 10 at 14:24
1
$begingroup$
Cool! Since the Arecibo messages is 210 bytes (23 * 73 / 8 = 209.875), your solution (currently at 200 bytes) is shorter than the message itself!
$endgroup$
– J-L
Apr 11 at 16:51
$begingroup$
I went ahead and made this the accepted answer since it was the first one to be shorter than the message itself.
$endgroup$
– Beefster
Apr 11 at 17:42
add a comment |
$begingroup$
05AB1E, 215 210 200 bytes
Saved 15 bytes thanks to Magic Octopus Urn
•cOž¤4é57ñΛÖ₃BαöĀíL½₅üBdoÙRθLγ¨G×Tćú$G(˜ƒ¦!€R»SDrµCnJ†d∊ζ·<8‡T@|‹ï=BζćósxGÙÎ$¿o₁5/ÔŸÇBûXé-”a::Ž]°∊y;ζ]MÜβ‘иL”βüÃÇíäc€÷›ÎU=¨иaŸdY`»¾ÚUβ:ô©¦β†₅DGŠβ3Jêθ,äá!ícqšVÖ›lÈΣ¯pε €êʃDpÙ/¬Žλ8:ãÿ3=€.Þć•3BY¾4×:
Try it online!
or with Additional formatting
Base-255 encoded trinary string with occurrences of 0000
replaced by 2
.
$endgroup$
05AB1E, 215 210 200 bytes
Saved 15 bytes thanks to Magic Octopus Urn
•cOž¤4é57ñΛÖ₃BαöĀíL½₅üBdoÙRθLγ¨G×Tćú$G(˜ƒ¦!€R»SDrµCnJ†d∊ζ·<8‡T@|‹ï=BζćósxGÙÎ$¿o₁5/ÔŸÇBûXé-”a::Ž]°∊y;ζ]MÜβ‘иL”βüÃÇíäc€÷›ÎU=¨иaŸdY`»¾ÚUβ:ô©¦β†₅DGŠβ3Jêθ,äá!ícqšVÖ›lÈΣ¯pε €êʃDpÙ/¬Žλ8:ãÿ3=€.Þć•3BY¾4×:
Try it online!
or with Additional formatting
Base-255 encoded trinary string with occurrences of 0000
replaced by 2
.
edited Apr 10 at 14:26
answered Apr 9 at 19:55
EmignaEmigna
48k434146
48k434146
$begingroup$
@MagicOctopusUrn: Thanks! That makes it 210 even :)
$endgroup$
– Emigna
Apr 10 at 14:15
$begingroup$
It's actually even better if you replace0000
with2
by 9 more bytes. - pastebin.com/aZ6tHxjx for 201
$endgroup$
– Magic Octopus Urn
Apr 10 at 14:19
$begingroup$
@MagicOctopusUrn: Yes, I found that as well and was just about to post it :)
$endgroup$
– Emigna
Apr 10 at 14:24
1
$begingroup$
Cool! Since the Arecibo messages is 210 bytes (23 * 73 / 8 = 209.875), your solution (currently at 200 bytes) is shorter than the message itself!
$endgroup$
– J-L
Apr 11 at 16:51
$begingroup$
I went ahead and made this the accepted answer since it was the first one to be shorter than the message itself.
$endgroup$
– Beefster
Apr 11 at 17:42
add a comment |
$begingroup$
@MagicOctopusUrn: Thanks! That makes it 210 even :)
$endgroup$
– Emigna
Apr 10 at 14:15
$begingroup$
It's actually even better if you replace0000
with2
by 9 more bytes. - pastebin.com/aZ6tHxjx for 201
$endgroup$
– Magic Octopus Urn
Apr 10 at 14:19
$begingroup$
@MagicOctopusUrn: Yes, I found that as well and was just about to post it :)
$endgroup$
– Emigna
Apr 10 at 14:24
1
$begingroup$
Cool! Since the Arecibo messages is 210 bytes (23 * 73 / 8 = 209.875), your solution (currently at 200 bytes) is shorter than the message itself!
$endgroup$
– J-L
Apr 11 at 16:51
$begingroup$
I went ahead and made this the accepted answer since it was the first one to be shorter than the message itself.
$endgroup$
– Beefster
Apr 11 at 17:42
$begingroup$
@MagicOctopusUrn: Thanks! That makes it 210 even :)
$endgroup$
– Emigna
Apr 10 at 14:15
$begingroup$
@MagicOctopusUrn: Thanks! That makes it 210 even :)
$endgroup$
– Emigna
Apr 10 at 14:15
$begingroup$
It's actually even better if you replace
0000
with 2
by 9 more bytes. - pastebin.com/aZ6tHxjx for 201$endgroup$
– Magic Octopus Urn
Apr 10 at 14:19
$begingroup$
It's actually even better if you replace
0000
with 2
by 9 more bytes. - pastebin.com/aZ6tHxjx for 201$endgroup$
– Magic Octopus Urn
Apr 10 at 14:19
$begingroup$
@MagicOctopusUrn: Yes, I found that as well and was just about to post it :)
$endgroup$
– Emigna
Apr 10 at 14:24
$begingroup$
@MagicOctopusUrn: Yes, I found that as well and was just about to post it :)
$endgroup$
– Emigna
Apr 10 at 14:24
1
1
$begingroup$
Cool! Since the Arecibo messages is 210 bytes (23 * 73 / 8 = 209.875), your solution (currently at 200 bytes) is shorter than the message itself!
$endgroup$
– J-L
Apr 11 at 16:51
$begingroup$
Cool! Since the Arecibo messages is 210 bytes (23 * 73 / 8 = 209.875), your solution (currently at 200 bytes) is shorter than the message itself!
$endgroup$
– J-L
Apr 11 at 16:51
$begingroup$
I went ahead and made this the accepted answer since it was the first one to be shorter than the message itself.
$endgroup$
– Beefster
Apr 11 at 17:42
$begingroup$
I went ahead and made this the accepted answer since it was the first one to be shorter than the message itself.
$endgroup$
– Beefster
Apr 11 at 17:42
add a comment |
$begingroup$
Java, 688 678 590 379 361 bytes
Returns a string.
n->new java.math.BigInteger("in95mzupnpa2r0khpoepyql6ioqyn413avucdtfay6indx4wh9dehe3sn18klobtf4z9g9q17umqmwpegr2khb5eqinn7azl4jpfp2a8eui0xfrx5qwrou6gd65jh4ge3ls14k5lu7qrvmg6942ms29u5rb8fa6yrdhfoh5zoi9bdi7uh5ig0u0ff9kounth8sh357x7qox4m3oqviqsbrvakonbka4ahp21bgzi5v1akzzuqoncszhpabbru9q1uo2g11zr73iuyiqr5ikr69zn7cdv7e1lhd6ese9",36).toString(3).replace("2","0000")
-10 bytes by returning the raw stream (old answer)
-88 bytes by using base 10 numerics (thanks @ceilingcat!)
-211 bytes (I knew it could be golfed!) by using a base-36 encoded BigInteger (thanks @JollyJoker!)
-18 bytes by using a different encoded integer (thanks again @JollyJoker)
Try it online!
Explanation:
n->new java.math.BigInteger("base36 string",36) // Decode the base-36 integer.
.toString(3) // Re-encode as ternary
.replace("2","0000") // Replace 2 with "0000"
// Implicit return
$endgroup$
1
$begingroup$
Comments are not for extended discussion; this conversation has been moved to chat.
$endgroup$
– Adam Lear♦
Apr 11 at 22:37
add a comment |
$begingroup$
Java, 688 678 590 379 361 bytes
Returns a string.
n->new java.math.BigInteger("in95mzupnpa2r0khpoepyql6ioqyn413avucdtfay6indx4wh9dehe3sn18klobtf4z9g9q17umqmwpegr2khb5eqinn7azl4jpfp2a8eui0xfrx5qwrou6gd65jh4ge3ls14k5lu7qrvmg6942ms29u5rb8fa6yrdhfoh5zoi9bdi7uh5ig0u0ff9kounth8sh357x7qox4m3oqviqsbrvakonbka4ahp21bgzi5v1akzzuqoncszhpabbru9q1uo2g11zr73iuyiqr5ikr69zn7cdv7e1lhd6ese9",36).toString(3).replace("2","0000")
-10 bytes by returning the raw stream (old answer)
-88 bytes by using base 10 numerics (thanks @ceilingcat!)
-211 bytes (I knew it could be golfed!) by using a base-36 encoded BigInteger (thanks @JollyJoker!)
-18 bytes by using a different encoded integer (thanks again @JollyJoker)
Try it online!
Explanation:
n->new java.math.BigInteger("base36 string",36) // Decode the base-36 integer.
.toString(3) // Re-encode as ternary
.replace("2","0000") // Replace 2 with "0000"
// Implicit return
$endgroup$
1
$begingroup$
Comments are not for extended discussion; this conversation has been moved to chat.
$endgroup$
– Adam Lear♦
Apr 11 at 22:37
add a comment |
$begingroup$
Java, 688 678 590 379 361 bytes
Returns a string.
n->new java.math.BigInteger("in95mzupnpa2r0khpoepyql6ioqyn413avucdtfay6indx4wh9dehe3sn18klobtf4z9g9q17umqmwpegr2khb5eqinn7azl4jpfp2a8eui0xfrx5qwrou6gd65jh4ge3ls14k5lu7qrvmg6942ms29u5rb8fa6yrdhfoh5zoi9bdi7uh5ig0u0ff9kounth8sh357x7qox4m3oqviqsbrvakonbka4ahp21bgzi5v1akzzuqoncszhpabbru9q1uo2g11zr73iuyiqr5ikr69zn7cdv7e1lhd6ese9",36).toString(3).replace("2","0000")
-10 bytes by returning the raw stream (old answer)
-88 bytes by using base 10 numerics (thanks @ceilingcat!)
-211 bytes (I knew it could be golfed!) by using a base-36 encoded BigInteger (thanks @JollyJoker!)
-18 bytes by using a different encoded integer (thanks again @JollyJoker)
Try it online!
Explanation:
n->new java.math.BigInteger("base36 string",36) // Decode the base-36 integer.
.toString(3) // Re-encode as ternary
.replace("2","0000") // Replace 2 with "0000"
// Implicit return
$endgroup$
Java, 688 678 590 379 361 bytes
Returns a string.
n->new java.math.BigInteger("in95mzupnpa2r0khpoepyql6ioqyn413avucdtfay6indx4wh9dehe3sn18klobtf4z9g9q17umqmwpegr2khb5eqinn7azl4jpfp2a8eui0xfrx5qwrou6gd65jh4ge3ls14k5lu7qrvmg6942ms29u5rb8fa6yrdhfoh5zoi9bdi7uh5ig0u0ff9kounth8sh357x7qox4m3oqviqsbrvakonbka4ahp21bgzi5v1akzzuqoncszhpabbru9q1uo2g11zr73iuyiqr5ikr69zn7cdv7e1lhd6ese9",36).toString(3).replace("2","0000")
-10 bytes by returning the raw stream (old answer)
-88 bytes by using base 10 numerics (thanks @ceilingcat!)
-211 bytes (I knew it could be golfed!) by using a base-36 encoded BigInteger (thanks @JollyJoker!)
-18 bytes by using a different encoded integer (thanks again @JollyJoker)
Try it online!
Explanation:
n->new java.math.BigInteger("base36 string",36) // Decode the base-36 integer.
.toString(3) // Re-encode as ternary
.replace("2","0000") // Replace 2 with "0000"
// Implicit return
edited yesterday
answered Apr 9 at 19:03
Benjamin UrquhartBenjamin Urquhart
51018
51018
1
$begingroup$
Comments are not for extended discussion; this conversation has been moved to chat.
$endgroup$
– Adam Lear♦
Apr 11 at 22:37
add a comment |
1
$begingroup$
Comments are not for extended discussion; this conversation has been moved to chat.
$endgroup$
– Adam Lear♦
Apr 11 at 22:37
1
1
$begingroup$
Comments are not for extended discussion; this conversation has been moved to chat.
$endgroup$
– Adam Lear♦
Apr 11 at 22:37
$begingroup$
Comments are not for extended discussion; this conversation has been moved to chat.
$endgroup$
– Adam Lear♦
Apr 11 at 22:37
add a comment |
$begingroup$
Jelly, 213 bytes
“H²ɓ¶Ṡḷ€ẹ]ƒf*ḳḢ&ƁṇOḥḄṫwỊ+oLạʋߢH9¢¹÷ỴɗÇ⁶ƲƙæḊẋ3³=1!VƇƁ'D⁺3Ỵɱ©⁵%fȯez#ƈjƒżṆo.ZF⁶ċṢ⁶ọṛb9Ȯƒd?ƁUĠt4ẇ,ḞġƒµƭfʠƁP§÷øȤŻPɲẋ(¢ß¢(⁽3¶ṙėɗy@ṁYȮL~e⁷ƤĊ§nỊṅµṠ°@7ẠB>Ġ⁻İuy¡½:esOpḢt}qS©HÞṬĖṛṇḣ9÷;ESḢ,Ẉ^ṙpƲ©tṃwçnẒṆ¡⁻Jıƒị£-&Ɱ*ẋʂżoȯÑḢɼ’
Try it online!
I played around with Huffman coding, but the improvements in data size were outweighed by the extra code. As such, this is simply a base-250 encoded version of the desired output. Output consists of an integer that when decoded as bijective base 2 will yield the 1D list of 1s and 2s. Thanks @Emigna for pointing out the change in rules.
Try it online - with further decoding to demonstrate output!
If a more conventional binary encoding is preferred, here is one that encodes an integer representation of the inverted binary message. The most significant bit of the integer represents the beginning of the message.
$endgroup$
add a comment |
$begingroup$
Jelly, 213 bytes
“H²ɓ¶Ṡḷ€ẹ]ƒf*ḳḢ&ƁṇOḥḄṫwỊ+oLạʋߢH9¢¹÷ỴɗÇ⁶ƲƙæḊẋ3³=1!VƇƁ'D⁺3Ỵɱ©⁵%fȯez#ƈjƒżṆo.ZF⁶ċṢ⁶ọṛb9Ȯƒd?ƁUĠt4ẇ,ḞġƒµƭfʠƁP§÷øȤŻPɲẋ(¢ß¢(⁽3¶ṙėɗy@ṁYȮL~e⁷ƤĊ§nỊṅµṠ°@7ẠB>Ġ⁻İuy¡½:esOpḢt}qS©HÞṬĖṛṇḣ9÷;ESḢ,Ẉ^ṙpƲ©tṃwçnẒṆ¡⁻Jıƒị£-&Ɱ*ẋʂżoȯÑḢɼ’
Try it online!
I played around with Huffman coding, but the improvements in data size were outweighed by the extra code. As such, this is simply a base-250 encoded version of the desired output. Output consists of an integer that when decoded as bijective base 2 will yield the 1D list of 1s and 2s. Thanks @Emigna for pointing out the change in rules.
Try it online - with further decoding to demonstrate output!
If a more conventional binary encoding is preferred, here is one that encodes an integer representation of the inverted binary message. The most significant bit of the integer represents the beginning of the message.
$endgroup$
add a comment |
$begingroup$
Jelly, 213 bytes
“H²ɓ¶Ṡḷ€ẹ]ƒf*ḳḢ&ƁṇOḥḄṫwỊ+oLạʋߢH9¢¹÷ỴɗÇ⁶ƲƙæḊẋ3³=1!VƇƁ'D⁺3Ỵɱ©⁵%fȯez#ƈjƒżṆo.ZF⁶ċṢ⁶ọṛb9Ȯƒd?ƁUĠt4ẇ,ḞġƒµƭfʠƁP§÷øȤŻPɲẋ(¢ß¢(⁽3¶ṙėɗy@ṁYȮL~e⁷ƤĊ§nỊṅµṠ°@7ẠB>Ġ⁻İuy¡½:esOpḢt}qS©HÞṬĖṛṇḣ9÷;ESḢ,Ẉ^ṙpƲ©tṃwçnẒṆ¡⁻Jıƒị£-&Ɱ*ẋʂżoȯÑḢɼ’
Try it online!
I played around with Huffman coding, but the improvements in data size were outweighed by the extra code. As such, this is simply a base-250 encoded version of the desired output. Output consists of an integer that when decoded as bijective base 2 will yield the 1D list of 1s and 2s. Thanks @Emigna for pointing out the change in rules.
Try it online - with further decoding to demonstrate output!
If a more conventional binary encoding is preferred, here is one that encodes an integer representation of the inverted binary message. The most significant bit of the integer represents the beginning of the message.
$endgroup$
Jelly, 213 bytes
“H²ɓ¶Ṡḷ€ẹ]ƒf*ḳḢ&ƁṇOḥḄṫwỊ+oLạʋߢH9¢¹÷ỴɗÇ⁶ƲƙæḊẋ3³=1!VƇƁ'D⁺3Ỵɱ©⁵%fȯez#ƈjƒżṆo.ZF⁶ċṢ⁶ọṛb9Ȯƒd?ƁUĠt4ẇ,ḞġƒµƭfʠƁP§÷øȤŻPɲẋ(¢ß¢(⁽3¶ṙėɗy@ṁYȮL~e⁷ƤĊ§nỊṅµṠ°@7ẠB>Ġ⁻İuy¡½:esOpḢt}qS©HÞṬĖṛṇḣ9÷;ESḢ,Ẉ^ṙpƲ©tṃwçnẒṆ¡⁻Jıƒị£-&Ɱ*ẋʂżoȯÑḢɼ’
Try it online!
I played around with Huffman coding, but the improvements in data size were outweighed by the extra code. As such, this is simply a base-250 encoded version of the desired output. Output consists of an integer that when decoded as bijective base 2 will yield the 1D list of 1s and 2s. Thanks @Emigna for pointing out the change in rules.
Try it online - with further decoding to demonstrate output!
If a more conventional binary encoding is preferred, here is one that encodes an integer representation of the inverted binary message. The most significant bit of the integer represents the beginning of the message.
edited Apr 9 at 20:39
answered Apr 9 at 20:02
Nick KennedyNick Kennedy
1,56649
1,56649
add a comment |
add a comment |
$begingroup$
Brainfuck, 2360 2008 1938 bytes
-[>+<-----]>---......+.-.+.-.+.-.+.-............+.-.+.-.....+.-.+.-.......+.-.<++++[->.+.-..<]>+.-.+..-.<+++++++++[->.+.-<]>..+.-..+.-<++++++[->......<]>.+.<++[->.-...................+..-.+<]>.-..................+.-.+.-.+.-..................+.....-<++++++++[->....<]>+..-....+...-...+..-....+..-...+.-.............+..-..+.-....+..-.+.-...+..-...+..-....+..-.+<++++[->.-.+....<]>.-<+++++[->.....<]>.+.-.................+.-............................+.-.................+......-.............+.....-.......................+..-....+..-....+...-...+..-...+.-.......+.-.........+.-....+..-.+.-....+..-...+...-..+..-.+.-.+.....-.+.....-.+.....-.+.....-..........................+.-......+..-.........+.-...........+..-...............+.-.....+..-..........+......-.....+..-......+.....-..........+..-.....<+++[->........+.-<]>.....+.-......+..-.......+.-.......+..-....+..-......+.-..........+..-...+.-....+..-...............+..-..+..-.............+..-...+.-....+..-.........+..-....+..-......+.-.......+.-......+.-........+.-.....+.-<++[->.......+..-........+.-...+.-.<]>........+.-.......+.-<++++[->.....+.-..<]>..........+..-.........+..-........+..-.........+.-...+...-.+.-.+..-...........+.-.......+.-..............+.-.....+.....-............+.-....+.-.+...-.+.-..+.-.+..-.+..-......+.-..+...-..+.-..+.......-.+...-....+...-.....+..-.+...-.........+.-.+.-.....+...-.+..-..+.-......+.-.+.-.....+......-..+.-......+.-.+.-.....+..-......+.-.....+..-.+..-<+++++++[->.....<]>+...-.....+.-..............+...-.+.-.+.-..<++++++[->.+.-<]>..+...-.........+.-.+.-.+.-.+.-................+.-.+.-..............+.....-................+.........-............+...-.......+...-.<++[->........+..-...<]>....+..-.+.-.........+.-.+..-<++[->.....+..-..+..-..<]>..+.-...+.-.+.-.....+.-.+.-...+.-..<+++[->..+.-...+.-<]>........+.-...+.-.+.-...+.-............+.-....+.-.<++[->...+.-.........<]>+.-..............+.-..+.-.+.-...........+....-..+.....-.+.-..+....-...
Try it online!
I will probably golf this even further soon.
$endgroup$
add a comment |
$begingroup$
Brainfuck, 2360 2008 1938 bytes
-[>+<-----]>---......+.-.+.-.+.-.+.-............+.-.+.-.....+.-.+.-.......+.-.<++++[->.+.-..<]>+.-.+..-.<+++++++++[->.+.-<]>..+.-..+.-<++++++[->......<]>.+.<++[->.-...................+..-.+<]>.-..................+.-.+.-.+.-..................+.....-<++++++++[->....<]>+..-....+...-...+..-....+..-...+.-.............+..-..+.-....+..-.+.-...+..-...+..-....+..-.+<++++[->.-.+....<]>.-<+++++[->.....<]>.+.-.................+.-............................+.-.................+......-.............+.....-.......................+..-....+..-....+...-...+..-...+.-.......+.-.........+.-....+..-.+.-....+..-...+...-..+..-.+.-.+.....-.+.....-.+.....-.+.....-..........................+.-......+..-.........+.-...........+..-...............+.-.....+..-..........+......-.....+..-......+.....-..........+..-.....<+++[->........+.-<]>.....+.-......+..-.......+.-.......+..-....+..-......+.-..........+..-...+.-....+..-...............+..-..+..-.............+..-...+.-....+..-.........+..-....+..-......+.-.......+.-......+.-........+.-.....+.-<++[->.......+..-........+.-...+.-.<]>........+.-.......+.-<++++[->.....+.-..<]>..........+..-.........+..-........+..-.........+.-...+...-.+.-.+..-...........+.-.......+.-..............+.-.....+.....-............+.-....+.-.+...-.+.-..+.-.+..-.+..-......+.-..+...-..+.-..+.......-.+...-....+...-.....+..-.+...-.........+.-.+.-.....+...-.+..-..+.-......+.-.+.-.....+......-..+.-......+.-.+.-.....+..-......+.-.....+..-.+..-<+++++++[->.....<]>+...-.....+.-..............+...-.+.-.+.-..<++++++[->.+.-<]>..+...-.........+.-.+.-.+.-.+.-................+.-.+.-..............+.....-................+.........-............+...-.......+...-.<++[->........+..-...<]>....+..-.+.-.........+.-.+..-<++[->.....+..-..+..-..<]>..+.-...+.-.+.-.....+.-.+.-...+.-..<+++[->..+.-...+.-<]>........+.-...+.-.+.-...+.-............+.-....+.-.<++[->...+.-.........<]>+.-..............+.-..+.-.+.-...........+....-..+.....-.+.-..+....-...
Try it online!
I will probably golf this even further soon.
$endgroup$
add a comment |
$begingroup$
Brainfuck, 2360 2008 1938 bytes
-[>+<-----]>---......+.-.+.-.+.-.+.-............+.-.+.-.....+.-.+.-.......+.-.<++++[->.+.-..<]>+.-.+..-.<+++++++++[->.+.-<]>..+.-..+.-<++++++[->......<]>.+.<++[->.-...................+..-.+<]>.-..................+.-.+.-.+.-..................+.....-<++++++++[->....<]>+..-....+...-...+..-....+..-...+.-.............+..-..+.-....+..-.+.-...+..-...+..-....+..-.+<++++[->.-.+....<]>.-<+++++[->.....<]>.+.-.................+.-............................+.-.................+......-.............+.....-.......................+..-....+..-....+...-...+..-...+.-.......+.-.........+.-....+..-.+.-....+..-...+...-..+..-.+.-.+.....-.+.....-.+.....-.+.....-..........................+.-......+..-.........+.-...........+..-...............+.-.....+..-..........+......-.....+..-......+.....-..........+..-.....<+++[->........+.-<]>.....+.-......+..-.......+.-.......+..-....+..-......+.-..........+..-...+.-....+..-...............+..-..+..-.............+..-...+.-....+..-.........+..-....+..-......+.-.......+.-......+.-........+.-.....+.-<++[->.......+..-........+.-...+.-.<]>........+.-.......+.-<++++[->.....+.-..<]>..........+..-.........+..-........+..-.........+.-...+...-.+.-.+..-...........+.-.......+.-..............+.-.....+.....-............+.-....+.-.+...-.+.-..+.-.+..-.+..-......+.-..+...-..+.-..+.......-.+...-....+...-.....+..-.+...-.........+.-.+.-.....+...-.+..-..+.-......+.-.+.-.....+......-..+.-......+.-.+.-.....+..-......+.-.....+..-.+..-<+++++++[->.....<]>+...-.....+.-..............+...-.+.-.+.-..<++++++[->.+.-<]>..+...-.........+.-.+.-.+.-.+.-................+.-.+.-..............+.....-................+.........-............+...-.......+...-.<++[->........+..-...<]>....+..-.+.-.........+.-.+..-<++[->.....+..-..+..-..<]>..+.-...+.-.+.-.....+.-.+.-...+.-..<+++[->..+.-...+.-<]>........+.-...+.-.+.-...+.-............+.-....+.-.<++[->...+.-.........<]>+.-..............+.-..+.-.+.-...........+....-..+.....-.+.-..+....-...
Try it online!
I will probably golf this even further soon.
$endgroup$
Brainfuck, 2360 2008 1938 bytes
-[>+<-----]>---......+.-.+.-.+.-.+.-............+.-.+.-.....+.-.+.-.......+.-.<++++[->.+.-..<]>+.-.+..-.<+++++++++[->.+.-<]>..+.-..+.-<++++++[->......<]>.+.<++[->.-...................+..-.+<]>.-..................+.-.+.-.+.-..................+.....-<++++++++[->....<]>+..-....+...-...+..-....+..-...+.-.............+..-..+.-....+..-.+.-...+..-...+..-....+..-.+<++++[->.-.+....<]>.-<+++++[->.....<]>.+.-.................+.-............................+.-.................+......-.............+.....-.......................+..-....+..-....+...-...+..-...+.-.......+.-.........+.-....+..-.+.-....+..-...+...-..+..-.+.-.+.....-.+.....-.+.....-.+.....-..........................+.-......+..-.........+.-...........+..-...............+.-.....+..-..........+......-.....+..-......+.....-..........+..-.....<+++[->........+.-<]>.....+.-......+..-.......+.-.......+..-....+..-......+.-..........+..-...+.-....+..-...............+..-..+..-.............+..-...+.-....+..-.........+..-....+..-......+.-.......+.-......+.-........+.-.....+.-<++[->.......+..-........+.-...+.-.<]>........+.-.......+.-<++++[->.....+.-..<]>..........+..-.........+..-........+..-.........+.-...+...-.+.-.+..-...........+.-.......+.-..............+.-.....+.....-............+.-....+.-.+...-.+.-..+.-.+..-.+..-......+.-..+...-..+.-..+.......-.+...-....+...-.....+..-.+...-.........+.-.+.-.....+...-.+..-..+.-......+.-.+.-.....+......-..+.-......+.-.+.-.....+..-......+.-.....+..-.+..-<+++++++[->.....<]>+...-.....+.-..............+...-.+.-.+.-..<++++++[->.+.-<]>..+...-.........+.-.+.-.+.-.+.-................+.-.+.-..............+.....-................+.........-............+...-.......+...-.<++[->........+..-...<]>....+..-.+.-.........+.-.+..-<++[->.....+..-..+..-..<]>..+.-...+.-.+.-.....+.-.+.-...+.-..<+++[->..+.-...+.-<]>........+.-...+.-.+.-...+.-............+.-....+.-.<++[->...+.-.........<]>+.-..............+.-..+.-.+.-...........+....-..+.....-.+.-..+....-...
Try it online!
I will probably golf this even further soon.
edited Apr 11 at 15:50
answered Apr 9 at 20:21
orthoplexorthoplex
1614
1614
add a comment |
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 366 332 329 319 bytes
int i;foreach(var g in"*ЀʂЄ࢈ҲપԤ␀␀␀ȀȀȀ␀␀సؘࠀƐഘؚ྾ߟ␀␀Ā␀␀ྀ␀␀రܘࠈഌΚ྾ߟ␀␀ă␀ྃ␀ȁăÃ1`ƀ1`ÃĂȃЃЁȂĀ`ÀƀȺȂ␀ȏЀȗɛ'Ŀஇ7;ȅ?ȅ0ȍЀ␀␀␀ΨՕŔ␀ŀЀ?܀àǀƀ`̀°٠Ƙѐʈш҈EB@Ѐޟɸ")Write(Convert.ToString(g,2).PadLeft(12-i++%2,'0'));
Replace all instances of ␀
with to test.
Try it online!
C# (Visual C# Interactive Compiler), 305 bytes, 210 chars
_=>"*ЀʂЄ࢈ҲપԤ␀␀␀ȀȀȀ␀␀సؘࠀƐഘؚ྾ߟ␀␀Ā␀␀ྀ␀␀రܘࠈഌΚ྾ߟ␀␀ă␀ྃ␀ȁăÃ1`ƀ1`ÃĂȃЃЁȂĀ`ÀƀȺȂ␀ȏЀȗɛ'Ŀஇ7;ȅ?ȅ0ȍЀ␀␀␀ΨՕŔ␀ŀЀ?܀àǀƀ`̀°٠Ƙѐʈш҈EB@Ѐޟɸ".Select((g,i)=>Convert.ToString(g,2).PadLeft(12-i%2,'0'))
Same with above, replace with ␀
with to test. Output as
IEnumerable<string>
.
Try it online!(Courtesy of Jo King)
$endgroup$
$begingroup$
TIO link with NUL bytes
$endgroup$
– Jo King
Apr 10 at 6:47
$begingroup$
I believe the++
in12-i++%2
is a nop (at least, it worked for me when I removed it)
$endgroup$
– someone
Apr 10 at 12:24
$begingroup$
@someone They are a copy-paste from the old answer I forgot to remove
$endgroup$
– Embodiment of Ignorance
Apr 10 at 14:56
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 366 332 329 319 bytes
int i;foreach(var g in"*ЀʂЄ࢈ҲપԤ␀␀␀ȀȀȀ␀␀సؘࠀƐഘؚ྾ߟ␀␀Ā␀␀ྀ␀␀రܘࠈഌΚ྾ߟ␀␀ă␀ྃ␀ȁăÃ1`ƀ1`ÃĂȃЃЁȂĀ`ÀƀȺȂ␀ȏЀȗɛ'Ŀஇ7;ȅ?ȅ0ȍЀ␀␀␀ΨՕŔ␀ŀЀ?܀àǀƀ`̀°٠Ƙѐʈш҈EB@Ѐޟɸ")Write(Convert.ToString(g,2).PadLeft(12-i++%2,'0'));
Replace all instances of ␀
with to test.
Try it online!
C# (Visual C# Interactive Compiler), 305 bytes, 210 chars
_=>"*ЀʂЄ࢈ҲપԤ␀␀␀ȀȀȀ␀␀సؘࠀƐഘؚ྾ߟ␀␀Ā␀␀ྀ␀␀రܘࠈഌΚ྾ߟ␀␀ă␀ྃ␀ȁăÃ1`ƀ1`ÃĂȃЃЁȂĀ`ÀƀȺȂ␀ȏЀȗɛ'Ŀஇ7;ȅ?ȅ0ȍЀ␀␀␀ΨՕŔ␀ŀЀ?܀àǀƀ`̀°٠Ƙѐʈш҈EB@Ѐޟɸ".Select((g,i)=>Convert.ToString(g,2).PadLeft(12-i%2,'0'))
Same with above, replace with ␀
with to test. Output as
IEnumerable<string>
.
Try it online!(Courtesy of Jo King)
$endgroup$
$begingroup$
TIO link with NUL bytes
$endgroup$
– Jo King
Apr 10 at 6:47
$begingroup$
I believe the++
in12-i++%2
is a nop (at least, it worked for me when I removed it)
$endgroup$
– someone
Apr 10 at 12:24
$begingroup$
@someone They are a copy-paste from the old answer I forgot to remove
$endgroup$
– Embodiment of Ignorance
Apr 10 at 14:56
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 366 332 329 319 bytes
int i;foreach(var g in"*ЀʂЄ࢈ҲપԤ␀␀␀ȀȀȀ␀␀సؘࠀƐഘؚ྾ߟ␀␀Ā␀␀ྀ␀␀రܘࠈഌΚ྾ߟ␀␀ă␀ྃ␀ȁăÃ1`ƀ1`ÃĂȃЃЁȂĀ`ÀƀȺȂ␀ȏЀȗɛ'Ŀஇ7;ȅ?ȅ0ȍЀ␀␀␀ΨՕŔ␀ŀЀ?܀àǀƀ`̀°٠Ƙѐʈш҈EB@Ѐޟɸ")Write(Convert.ToString(g,2).PadLeft(12-i++%2,'0'));
Replace all instances of ␀
with to test.
Try it online!
C# (Visual C# Interactive Compiler), 305 bytes, 210 chars
_=>"*ЀʂЄ࢈ҲપԤ␀␀␀ȀȀȀ␀␀సؘࠀƐഘؚ྾ߟ␀␀Ā␀␀ྀ␀␀రܘࠈഌΚ྾ߟ␀␀ă␀ྃ␀ȁăÃ1`ƀ1`ÃĂȃЃЁȂĀ`ÀƀȺȂ␀ȏЀȗɛ'Ŀஇ7;ȅ?ȅ0ȍЀ␀␀␀ΨՕŔ␀ŀЀ?܀àǀƀ`̀°٠Ƙѐʈш҈EB@Ѐޟɸ".Select((g,i)=>Convert.ToString(g,2).PadLeft(12-i%2,'0'))
Same with above, replace with ␀
with to test. Output as
IEnumerable<string>
.
Try it online!(Courtesy of Jo King)
$endgroup$
C# (Visual C# Interactive Compiler), 366 332 329 319 bytes
int i;foreach(var g in"*ЀʂЄ࢈ҲપԤ␀␀␀ȀȀȀ␀␀సؘࠀƐഘؚ྾ߟ␀␀Ā␀␀ྀ␀␀రܘࠈഌΚ྾ߟ␀␀ă␀ྃ␀ȁăÃ1`ƀ1`ÃĂȃЃЁȂĀ`ÀƀȺȂ␀ȏЀȗɛ'Ŀஇ7;ȅ?ȅ0ȍЀ␀␀␀ΨՕŔ␀ŀЀ?܀àǀƀ`̀°٠Ƙѐʈш҈EB@Ѐޟɸ")Write(Convert.ToString(g,2).PadLeft(12-i++%2,'0'));
Replace all instances of ␀
with to test.
Try it online!
C# (Visual C# Interactive Compiler), 305 bytes, 210 chars
_=>"*ЀʂЄ࢈ҲપԤ␀␀␀ȀȀȀ␀␀సؘࠀƐഘؚ྾ߟ␀␀Ā␀␀ྀ␀␀రܘࠈഌΚ྾ߟ␀␀ă␀ྃ␀ȁăÃ1`ƀ1`ÃĂȃЃЁȂĀ`ÀƀȺȂ␀ȏЀȗɛ'Ŀஇ7;ȅ?ȅ0ȍЀ␀␀␀ΨՕŔ␀ŀЀ?܀àǀƀ`̀°٠Ƙѐʈш҈EB@Ѐޟɸ".Select((g,i)=>Convert.ToString(g,2).PadLeft(12-i%2,'0'))
Same with above, replace with ␀
with to test. Output as
IEnumerable<string>
.
Try it online!(Courtesy of Jo King)
edited Apr 10 at 15:31
answered Apr 9 at 20:49
Embodiment of IgnoranceEmbodiment of Ignorance
2,956127
2,956127
$begingroup$
TIO link with NUL bytes
$endgroup$
– Jo King
Apr 10 at 6:47
$begingroup$
I believe the++
in12-i++%2
is a nop (at least, it worked for me when I removed it)
$endgroup$
– someone
Apr 10 at 12:24
$begingroup$
@someone They are a copy-paste from the old answer I forgot to remove
$endgroup$
– Embodiment of Ignorance
Apr 10 at 14:56
add a comment |
$begingroup$
TIO link with NUL bytes
$endgroup$
– Jo King
Apr 10 at 6:47
$begingroup$
I believe the++
in12-i++%2
is a nop (at least, it worked for me when I removed it)
$endgroup$
– someone
Apr 10 at 12:24
$begingroup$
@someone They are a copy-paste from the old answer I forgot to remove
$endgroup$
– Embodiment of Ignorance
Apr 10 at 14:56
$begingroup$
TIO link with NUL bytes
$endgroup$
– Jo King
Apr 10 at 6:47
$begingroup$
TIO link with NUL bytes
$endgroup$
– Jo King
Apr 10 at 6:47
$begingroup$
I believe the
++
in 12-i++%2
is a nop (at least, it worked for me when I removed it)$endgroup$
– someone
Apr 10 at 12:24
$begingroup$
I believe the
++
in 12-i++%2
is a nop (at least, it worked for me when I removed it)$endgroup$
– someone
Apr 10 at 12:24
$begingroup$
@someone They are a copy-paste from the old answer I forgot to remove
$endgroup$
– Embodiment of Ignorance
Apr 10 at 14:56
$begingroup$
@someone They are a copy-paste from the old answer I forgot to remove
$endgroup$
– Embodiment of Ignorance
Apr 10 at 14:56
add a comment |
$begingroup$
Deadfish~, 1115 bytes
ooooooiodoiodoiodoiodoicdooiodoiodoooooiodoiodoooooooiodooicdiodoooiodoooiodoooiodooiodoioodooiodoicdiodoiodoiodoiodoiodoiodoiodoiodooiodooiodooicdoooooicdoooioodoooooooooicdoioodoiodoooooooooicdoioodoiodoooooooooicdoooooooooiodoiodoiodoooooooooicdoooooooooiooooodoooooooooicdoooooicdioodooooiooodoooioodooooioodoooicdiodooooioodooiodooooicdioodoiodoooioodoooioodooooioodoiodoicdiooooodoiooooodoiooooodoiooooodicdoooooicdoooiodooooooooiodoicdoooooicdooooiodooooooooiodicdiooooodooooiooooodicdoooooicdioodooooioodooooiooodoooioodoooicdiodoooooooiodoooooooooiodooooicdioodoiodooooioodoooiooodooioodoiodoicdiooooodoiooooodoiooooodoiooooodicdoooooicdoooiodooooooioodoooooooooiodoicdoioodooicdooooiodoooooioodoiodicdiooooodoooooioodooooooiooooodicdoioodooicdooiodooooooooiodooooooooiodooicdoooiodooooooioodoooooooiodoooicdooooioodooooioodooooooiodooooicdooooooioodoooiodooooioodoooooicdoioodooioodoooooooicdooooooioodoooiodooooioodooooo
Try it online!
If someone has the patience to golf this further, I salute you ahead of time. :P
$endgroup$
add a comment |
$begingroup$
Deadfish~, 1115 bytes
ooooooiodoiodoiodoiodoicdooiodoiodoooooiodoiodoooooooiodooicdiodoooiodoooiodoooiodooiodoioodooiodoicdiodoiodoiodoiodoiodoiodoiodoiodooiodooiodooicdoooooicdoooioodoooooooooicdoioodoiodoooooooooicdoioodoiodoooooooooicdoooooooooiodoiodoiodoooooooooicdoooooooooiooooodoooooooooicdoooooicdioodooooiooodoooioodooooioodoooicdiodooooioodooiodooooicdioodoiodoooioodoooioodooooioodoiodoicdiooooodoiooooodoiooooodoiooooodicdoooooicdoooiodooooooooiodoicdoooooicdooooiodooooooooiodicdiooooodooooiooooodicdoooooicdioodooooioodooooiooodoooioodoooicdiodoooooooiodoooooooooiodooooicdioodoiodooooioodoooiooodooioodoiodoicdiooooodoiooooodoiooooodoiooooodicdoooooicdoooiodooooooioodoooooooooiodoicdoioodooicdooooiodoooooioodoiodicdiooooodoooooioodooooooiooooodicdoioodooicdooiodooooooooiodooooooooiodooicdoooiodooooooioodoooooooiodoooicdooooioodooooioodooooooiodooooicdooooooioodoooiodooooioodoooooicdoioodooioodoooooooicdooooooioodoooiodooooioodooooo
Try it online!
If someone has the patience to golf this further, I salute you ahead of time. :P
$endgroup$
add a comment |
$begingroup$
Deadfish~, 1115 bytes
ooooooiodoiodoiodoiodoicdooiodoiodoooooiodoiodoooooooiodooicdiodoooiodoooiodoooiodooiodoioodooiodoicdiodoiodoiodoiodoiodoiodoiodoiodooiodooiodooicdoooooicdoooioodoooooooooicdoioodoiodoooooooooicdoioodoiodoooooooooicdoooooooooiodoiodoiodoooooooooicdoooooooooiooooodoooooooooicdoooooicdioodooooiooodoooioodooooioodoooicdiodooooioodooiodooooicdioodoiodoooioodoooioodooooioodoiodoicdiooooodoiooooodoiooooodoiooooodicdoooooicdoooiodooooooooiodoicdoooooicdooooiodooooooooiodicdiooooodooooiooooodicdoooooicdioodooooioodooooiooodoooioodoooicdiodoooooooiodoooooooooiodooooicdioodoiodooooioodoooiooodooioodoiodoicdiooooodoiooooodoiooooodoiooooodicdoooooicdoooiodooooooioodoooooooooiodoicdoioodooicdooooiodoooooioodoiodicdiooooodoooooioodooooooiooooodicdoioodooicdooiodooooooooiodooooooooiodooicdoooiodooooooioodoooooooiodoooicdooooioodooooioodooooooiodooooicdooooooioodoooiodooooioodoooooicdoioodooioodoooooooicdooooooioodoooiodooooioodooooo
Try it online!
If someone has the patience to golf this further, I salute you ahead of time. :P
$endgroup$
Deadfish~, 1115 bytes
ooooooiodoiodoiodoiodoicdooiodoiodoooooiodoiodoooooooiodooicdiodoooiodoooiodoooiodooiodoioodooiodoicdiodoiodoiodoiodoiodoiodoiodoiodooiodooiodooicdoooooicdoooioodoooooooooicdoioodoiodoooooooooicdoioodoiodoooooooooicdoooooooooiodoiodoiodoooooooooicdoooooooooiooooodoooooooooicdoooooicdioodooooiooodoooioodooooioodoooicdiodooooioodooiodooooicdioodoiodoooioodoooioodooooioodoiodoicdiooooodoiooooodoiooooodoiooooodicdoooooicdoooiodooooooooiodoicdoooooicdooooiodooooooooiodicdiooooodooooiooooodicdoooooicdioodooooioodooooiooodoooioodoooicdiodoooooooiodoooooooooiodooooicdioodoiodooooioodoooiooodooioodoiodoicdiooooodoiooooodoiooooodoiooooodicdoooooicdoooiodooooooioodoooooooooiodoicdoioodooicdooooiodoooooioodoiodicdiooooodoooooioodooooooiooooodicdoioodooicdooiodooooooooiodooooooooiodooicdoooiodooooooioodoooooooiodoooicdooooioodooooioodooooooiodooooicdooooooioodoooiodooooioodoooooicdoioodooioodoooooooicdooooooioodoooiodooooioodooooo
Try it online!
If someone has the patience to golf this further, I salute you ahead of time. :P
answered Apr 9 at 20:28
squidsquid
1214
1214
add a comment |
add a comment |
$begingroup$
Perl 6, 368 bytes
.say for :36('FJXOE0PDDNF5Y5EHGB8M9SWMXQOXIKIT9F6ZKWWDEACHCBGXL1N2H60CN0CJ4EMKF7D6MODSKYJVNR4SFTDR6NSM421LQ67B6MWF0G5BQATFOJJJBQ0UFQM64T0MWSQN41C4S5D1QR5KJM2L9UTYMMKUBBQWY45YCMRGO8ZRGTQH7LXMZBUASLCTKX30IH0AYKYEPHO8HFHX8GAY5WM38YOSUX0HABYSH2PPBLRDRZIN5ANAQ3V8PLOZ6EHC0UI95EVJVYD1820T6J14HGX85NWFQET2NWOMSNUT0JW4LHMY90X094TEE9KXJXSNN6YPERFQW').base(2).substr(1).comb(23)
Try it online!
The long string is the message as a single base-36 number (with a single prefixed 1 bit to preserve the leading zeroes) which is then converted back to binary and printed 23 bits at a time.
$endgroup$
$begingroup$
You can use>>.say
and&S/.//
to save bytes. Have you thought about using a different base instead?
$endgroup$
– Jo King
Apr 9 at 22:08
$begingroup$
Yes, I tried using base 65536/Unicode, but the message runs into some forbidden surrogate codepoints. I was able to avoid that by adding a fixed offset to each codepoint, but astonishingly, some of the generated strings crashed Emacs a few times. Resolving the issues started taking more time than I could afford to commit. I'll probably revisit the problem later.
$endgroup$
– Sean
Apr 9 at 22:36
$begingroup$
There's no point going into multiple byte characters, since that increases your byte count. 289 bytes by implementing my tips from above and using base 122 (to avoid carriage returns)
$endgroup$
– Jo King
Apr 10 at 0:58
add a comment |
$begingroup$
Perl 6, 368 bytes
.say for :36('FJXOE0PDDNF5Y5EHGB8M9SWMXQOXIKIT9F6ZKWWDEACHCBGXL1N2H60CN0CJ4EMKF7D6MODSKYJVNR4SFTDR6NSM421LQ67B6MWF0G5BQATFOJJJBQ0UFQM64T0MWSQN41C4S5D1QR5KJM2L9UTYMMKUBBQWY45YCMRGO8ZRGTQH7LXMZBUASLCTKX30IH0AYKYEPHO8HFHX8GAY5WM38YOSUX0HABYSH2PPBLRDRZIN5ANAQ3V8PLOZ6EHC0UI95EVJVYD1820T6J14HGX85NWFQET2NWOMSNUT0JW4LHMY90X094TEE9KXJXSNN6YPERFQW').base(2).substr(1).comb(23)
Try it online!
The long string is the message as a single base-36 number (with a single prefixed 1 bit to preserve the leading zeroes) which is then converted back to binary and printed 23 bits at a time.
$endgroup$
$begingroup$
You can use>>.say
and&S/.//
to save bytes. Have you thought about using a different base instead?
$endgroup$
– Jo King
Apr 9 at 22:08
$begingroup$
Yes, I tried using base 65536/Unicode, but the message runs into some forbidden surrogate codepoints. I was able to avoid that by adding a fixed offset to each codepoint, but astonishingly, some of the generated strings crashed Emacs a few times. Resolving the issues started taking more time than I could afford to commit. I'll probably revisit the problem later.
$endgroup$
– Sean
Apr 9 at 22:36
$begingroup$
There's no point going into multiple byte characters, since that increases your byte count. 289 bytes by implementing my tips from above and using base 122 (to avoid carriage returns)
$endgroup$
– Jo King
Apr 10 at 0:58
add a comment |
$begingroup$
Perl 6, 368 bytes
.say for :36('FJXOE0PDDNF5Y5EHGB8M9SWMXQOXIKIT9F6ZKWWDEACHCBGXL1N2H60CN0CJ4EMKF7D6MODSKYJVNR4SFTDR6NSM421LQ67B6MWF0G5BQATFOJJJBQ0UFQM64T0MWSQN41C4S5D1QR5KJM2L9UTYMMKUBBQWY45YCMRGO8ZRGTQH7LXMZBUASLCTKX30IH0AYKYEPHO8HFHX8GAY5WM38YOSUX0HABYSH2PPBLRDRZIN5ANAQ3V8PLOZ6EHC0UI95EVJVYD1820T6J14HGX85NWFQET2NWOMSNUT0JW4LHMY90X094TEE9KXJXSNN6YPERFQW').base(2).substr(1).comb(23)
Try it online!
The long string is the message as a single base-36 number (with a single prefixed 1 bit to preserve the leading zeroes) which is then converted back to binary and printed 23 bits at a time.
$endgroup$
Perl 6, 368 bytes
.say for :36('FJXOE0PDDNF5Y5EHGB8M9SWMXQOXIKIT9F6ZKWWDEACHCBGXL1N2H60CN0CJ4EMKF7D6MODSKYJVNR4SFTDR6NSM421LQ67B6MWF0G5BQATFOJJJBQ0UFQM64T0MWSQN41C4S5D1QR5KJM2L9UTYMMKUBBQWY45YCMRGO8ZRGTQH7LXMZBUASLCTKX30IH0AYKYEPHO8HFHX8GAY5WM38YOSUX0HABYSH2PPBLRDRZIN5ANAQ3V8PLOZ6EHC0UI95EVJVYD1820T6J14HGX85NWFQET2NWOMSNUT0JW4LHMY90X094TEE9KXJXSNN6YPERFQW').base(2).substr(1).comb(23)
Try it online!
The long string is the message as a single base-36 number (with a single prefixed 1 bit to preserve the leading zeroes) which is then converted back to binary and printed 23 bits at a time.
answered Apr 9 at 20:55
SeanSean
3,54637
3,54637
$begingroup$
You can use>>.say
and&S/.//
to save bytes. Have you thought about using a different base instead?
$endgroup$
– Jo King
Apr 9 at 22:08
$begingroup$
Yes, I tried using base 65536/Unicode, but the message runs into some forbidden surrogate codepoints. I was able to avoid that by adding a fixed offset to each codepoint, but astonishingly, some of the generated strings crashed Emacs a few times. Resolving the issues started taking more time than I could afford to commit. I'll probably revisit the problem later.
$endgroup$
– Sean
Apr 9 at 22:36
$begingroup$
There's no point going into multiple byte characters, since that increases your byte count. 289 bytes by implementing my tips from above and using base 122 (to avoid carriage returns)
$endgroup$
– Jo King
Apr 10 at 0:58
add a comment |
$begingroup$
You can use>>.say
and&S/.//
to save bytes. Have you thought about using a different base instead?
$endgroup$
– Jo King
Apr 9 at 22:08
$begingroup$
Yes, I tried using base 65536/Unicode, but the message runs into some forbidden surrogate codepoints. I was able to avoid that by adding a fixed offset to each codepoint, but astonishingly, some of the generated strings crashed Emacs a few times. Resolving the issues started taking more time than I could afford to commit. I'll probably revisit the problem later.
$endgroup$
– Sean
Apr 9 at 22:36
$begingroup$
There's no point going into multiple byte characters, since that increases your byte count. 289 bytes by implementing my tips from above and using base 122 (to avoid carriage returns)
$endgroup$
– Jo King
Apr 10 at 0:58
$begingroup$
You can use
>>.say
and &S/.//
to save bytes. Have you thought about using a different base instead?$endgroup$
– Jo King
Apr 9 at 22:08
$begingroup$
You can use
>>.say
and &S/.//
to save bytes. Have you thought about using a different base instead?$endgroup$
– Jo King
Apr 9 at 22:08
$begingroup$
Yes, I tried using base 65536/Unicode, but the message runs into some forbidden surrogate codepoints. I was able to avoid that by adding a fixed offset to each codepoint, but astonishingly, some of the generated strings crashed Emacs a few times. Resolving the issues started taking more time than I could afford to commit. I'll probably revisit the problem later.
$endgroup$
– Sean
Apr 9 at 22:36
$begingroup$
Yes, I tried using base 65536/Unicode, but the message runs into some forbidden surrogate codepoints. I was able to avoid that by adding a fixed offset to each codepoint, but astonishingly, some of the generated strings crashed Emacs a few times. Resolving the issues started taking more time than I could afford to commit. I'll probably revisit the problem later.
$endgroup$
– Sean
Apr 9 at 22:36
$begingroup$
There's no point going into multiple byte characters, since that increases your byte count. 289 bytes by implementing my tips from above and using base 122 (to avoid carriage returns)
$endgroup$
– Jo King
Apr 10 at 0:58
$begingroup$
There's no point going into multiple byte characters, since that increases your byte count. 289 bytes by implementing my tips from above and using base 122 (to avoid carriage returns)
$endgroup$
– Jo King
Apr 10 at 0:58
add a comment |
$begingroup$
Wolfram Language (Mathematica), 383 bytes
StringPartition[Uncompress@"1:eJylVNsRwjAM44s92KBaBTZgAUZhZXqtHUuOWrgjfSRRHFlO4tyer/vjfb1clq0gHirZLRjby986hppcT5p+L3BmgJ3t4Ul4GsNyG++7YbaXLh0ZTPhXa4Sn+X/s9Qfk3Hx2cOaSIuNYaVu5laschvgzSqAjHeZBhilKgKBDEhw0upJRg+HOK4MyNC29sfbc3RV0VPDqeLiRTsG1ulExq1IitpunOa7asnYM9siDZ6eidUCkEzBOUbCkGIig4aTyUGBYWAX6W6aXIWGGI/HlhmsqzSU0QTZjkMVpaX5sBsm1OGKVg1qdjKP0EdyqZBRLhukn8DLBQav6kccgz8OKfgBzjj6Z",23]
Try it online!
$endgroup$
add a comment |
$begingroup$
Wolfram Language (Mathematica), 383 bytes
StringPartition[Uncompress@"1:eJylVNsRwjAM44s92KBaBTZgAUZhZXqtHUuOWrgjfSRRHFlO4tyer/vjfb1clq0gHirZLRjby986hppcT5p+L3BmgJ3t4Ul4GsNyG++7YbaXLh0ZTPhXa4Sn+X/s9Qfk3Hx2cOaSIuNYaVu5laschvgzSqAjHeZBhilKgKBDEhw0upJRg+HOK4MyNC29sfbc3RV0VPDqeLiRTsG1ulExq1IitpunOa7asnYM9siDZ6eidUCkEzBOUbCkGIig4aTyUGBYWAX6W6aXIWGGI/HlhmsqzSU0QTZjkMVpaX5sBsm1OGKVg1qdjKP0EdyqZBRLhukn8DLBQav6kccgz8OKfgBzjj6Z",23]
Try it online!
$endgroup$
add a comment |
$begingroup$
Wolfram Language (Mathematica), 383 bytes
StringPartition[Uncompress@"1:eJylVNsRwjAM44s92KBaBTZgAUZhZXqtHUuOWrgjfSRRHFlO4tyer/vjfb1clq0gHirZLRjby986hppcT5p+L3BmgJ3t4Ul4GsNyG++7YbaXLh0ZTPhXa4Sn+X/s9Qfk3Hx2cOaSIuNYaVu5laschvgzSqAjHeZBhilKgKBDEhw0upJRg+HOK4MyNC29sfbc3RV0VPDqeLiRTsG1ulExq1IitpunOa7asnYM9siDZ6eidUCkEzBOUbCkGIig4aTyUGBYWAX6W6aXIWGGI/HlhmsqzSU0QTZjkMVpaX5sBsm1OGKVg1qdjKP0EdyqZBRLhukn8DLBQav6kccgz8OKfgBzjj6Z",23]
Try it online!
$endgroup$
Wolfram Language (Mathematica), 383 bytes
StringPartition[Uncompress@"1:eJylVNsRwjAM44s92KBaBTZgAUZhZXqtHUuOWrgjfSRRHFlO4tyer/vjfb1clq0gHirZLRjby986hppcT5p+L3BmgJ3t4Ul4GsNyG++7YbaXLh0ZTPhXa4Sn+X/s9Qfk3Hx2cOaSIuNYaVu5laschvgzSqAjHeZBhilKgKBDEhw0upJRg+HOK4MyNC29sfbc3RV0VPDqeLiRTsG1ulExq1IitpunOa7asnYM9siDZ6eidUCkEzBOUbCkGIig4aTyUGBYWAX6W6aXIWGGI/HlhmsqzSU0QTZjkMVpaX5sBsm1OGKVg1qdjKP0EdyqZBRLhukn8DLBQav6kccgz8OKfgBzjj6Z",23]
Try it online!
answered Apr 9 at 21:43
J42161217J42161217
14k21353
14k21353
add a comment |
add a comment |
$begingroup$
Node.js, 333 bytes
Returns a binary string of 1,679 characters.
_=>Buffer(")SI)=.);1K?>>>2333A3,93/I3>3)g33)AEAAI)5JQZJTddda3)*3*33+3,e)*e3)//0/1+)1C/7Cgggg3395)9)A3IY)h*IH),39+)995*)AA-)59Y)*O3Z,)//*)91**)A*-)Y+1)I11+)I1)/)5)Y*0?)+)I)-0Y)1@;_*7<gaE/a)Q7[*9HM+IY16I33)a1)*^.><I+S3.38I)*hY)7)a)Y)A,9*A5Y/A:9=9K:1I-=9)19I)9*329)GH<").map(x=>s+=(x-51&&x-41).toString(2).padStart(x-51?6:12,0),s='')&&s
Try it online! (with formatted output)
JavaScript (ES8), 413 bytes
Returns a binary string of 1,679 characters.
_=>atob('AsKoAFBQEiIlwpVVUk!!ABwo!DQ!Gg!V!Aw7g!!GHGHCi!yGjHChsK+w7vDr8K!!Q!Q!!g!/DgAHDs!AGGHDhiAgCGhjwprDu8Ovwr4!ABAw4AQAcK!MKDAD8GB8OAD!QCAQQMBAYYEAMQwABwpgAMQwBwoYEBAgEEBgEQDAIwoAgIMKAwoDCgMKABgDDgDAEdcKACAgAEHwAIXTCtgTDpMO+w6HDgcK4AsKDwrIFB8OkCgwINg!!A4IAB1FVTDoArCo!U!/CgAB/w4ADwoDDoAwAYDQBYMOMBmEUFEIkSMKARR!woQgAQB!MKUAHnDtA'.split`!`.join`AA`).replace(/[sS]/g,c=>c.charCodeAt().toString(2).padStart(8,0))
Try it online! (with formatted output)
$endgroup$
add a comment |
$begingroup$
Node.js, 333 bytes
Returns a binary string of 1,679 characters.
_=>Buffer(")SI)=.);1K?>>>2333A3,93/I3>3)g33)AEAAI)5JQZJTddda3)*3*33+3,e)*e3)//0/1+)1C/7Cgggg3395)9)A3IY)h*IH),39+)995*)AA-)59Y)*O3Z,)//*)91**)A*-)Y+1)I11+)I1)/)5)Y*0?)+)I)-0Y)1@;_*7<gaE/a)Q7[*9HM+IY16I33)a1)*^.><I+S3.38I)*hY)7)a)Y)A,9*A5Y/A:9=9K:1I-=9)19I)9*329)GH<").map(x=>s+=(x-51&&x-41).toString(2).padStart(x-51?6:12,0),s='')&&s
Try it online! (with formatted output)
JavaScript (ES8), 413 bytes
Returns a binary string of 1,679 characters.
_=>atob('AsKoAFBQEiIlwpVVUk!!ABwo!DQ!Gg!V!Aw7g!!GHGHCi!yGjHChsK+w7vDr8K!!Q!Q!!g!/DgAHDs!AGGHDhiAgCGhjwprDu8Ovwr4!ABAw4AQAcK!MKDAD8GB8OAD!QCAQQMBAYYEAMQwABwpgAMQwBwoYEBAgEEBgEQDAIwoAgIMKAwoDCgMKABgDDgDAEdcKACAgAEHwAIXTCtgTDpMO+w6HDgcK4AsKDwrIFB8OkCgwINg!!A4IAB1FVTDoArCo!U!/CgAB/w4ADwoDDoAwAYDQBYMOMBmEUFEIkSMKARR!woQgAQB!MKUAHnDtA'.split`!`.join`AA`).replace(/[sS]/g,c=>c.charCodeAt().toString(2).padStart(8,0))
Try it online! (with formatted output)
$endgroup$
add a comment |
$begingroup$
Node.js, 333 bytes
Returns a binary string of 1,679 characters.
_=>Buffer(")SI)=.);1K?>>>2333A3,93/I3>3)g33)AEAAI)5JQZJTddda3)*3*33+3,e)*e3)//0/1+)1C/7Cgggg3395)9)A3IY)h*IH),39+)995*)AA-)59Y)*O3Z,)//*)91**)A*-)Y+1)I11+)I1)/)5)Y*0?)+)I)-0Y)1@;_*7<gaE/a)Q7[*9HM+IY16I33)a1)*^.><I+S3.38I)*hY)7)a)Y)A,9*A5Y/A:9=9K:1I-=9)19I)9*329)GH<").map(x=>s+=(x-51&&x-41).toString(2).padStart(x-51?6:12,0),s='')&&s
Try it online! (with formatted output)
JavaScript (ES8), 413 bytes
Returns a binary string of 1,679 characters.
_=>atob('AsKoAFBQEiIlwpVVUk!!ABwo!DQ!Gg!V!Aw7g!!GHGHCi!yGjHChsK+w7vDr8K!!Q!Q!!g!/DgAHDs!AGGHDhiAgCGhjwprDu8Ovwr4!ABAw4AQAcK!MKDAD8GB8OAD!QCAQQMBAYYEAMQwABwpgAMQwBwoYEBAgEEBgEQDAIwoAgIMKAwoDCgMKABgDDgDAEdcKACAgAEHwAIXTCtgTDpMO+w6HDgcK4AsKDwrIFB8OkCgwINg!!A4IAB1FVTDoArCo!U!/CgAB/w4ADwoDDoAwAYDQBYMOMBmEUFEIkSMKARR!woQgAQB!MKUAHnDtA'.split`!`.join`AA`).replace(/[sS]/g,c=>c.charCodeAt().toString(2).padStart(8,0))
Try it online! (with formatted output)
$endgroup$
Node.js, 333 bytes
Returns a binary string of 1,679 characters.
_=>Buffer(")SI)=.);1K?>>>2333A3,93/I3>3)g33)AEAAI)5JQZJTddda3)*3*33+3,e)*e3)//0/1+)1C/7Cgggg3395)9)A3IY)h*IH),39+)995*)AA-)59Y)*O3Z,)//*)91**)A*-)Y+1)I11+)I1)/)5)Y*0?)+)I)-0Y)1@;_*7<gaE/a)Q7[*9HM+IY16I33)a1)*^.><I+S3.38I)*hY)7)a)Y)A,9*A5Y/A:9=9K:1I-=9)19I)9*329)GH<").map(x=>s+=(x-51&&x-41).toString(2).padStart(x-51?6:12,0),s='')&&s
Try it online! (with formatted output)
JavaScript (ES8), 413 bytes
Returns a binary string of 1,679 characters.
_=>atob('AsKoAFBQEiIlwpVVUk!!ABwo!DQ!Gg!V!Aw7g!!GHGHCi!yGjHChsK+w7vDr8K!!Q!Q!!g!/DgAHDs!AGGHDhiAgCGhjwprDu8Ovwr4!ABAw4AQAcK!MKDAD8GB8OAD!QCAQQMBAYYEAMQwABwpgAMQwBwoYEBAgEEBgEQDAIwoAgIMKAwoDCgMKABgDDgDAEdcKACAgAEHwAIXTCtgTDpMO+w6HDgcK4AsKDwrIFB8OkCgwINg!!A4IAB1FVTDoArCo!U!/CgAB/w4ADwoDDoAwAYDQBYMOMBmEUFEIkSMKARR!woQgAQB!MKUAHnDtA'.split`!`.join`AA`).replace(/[sS]/g,c=>c.charCodeAt().toString(2).padStart(8,0))
Try it online! (with formatted output)
edited Apr 9 at 21:51
answered Apr 9 at 20:16
ArnauldArnauld
80.9k797334
80.9k797334
add a comment |
add a comment |
$begingroup$
Bubblegum, 275 236 bytes
00000000: e006 8e00 e45d 0018 6988 6507 a228 f86f .....]..i.e..(.o
00000010: f042 c62f d4d7 b99e 38bc 56c4 52e8 2630 .B./....8.V.R.&0
00000020: 8aaa 7252 d47d 5ef4 c96a 511f 6842 423f ..rR.}^..jQ.hBB?
00000030: 4532 ca9f 22d3 1633 e0c4 665a d5dc 4e68 E2.."..3..fZ..Nh
00000040: 7b09 76ae 3c7e f9d4 fa4a 05e0 4163 c580 improve this answer
$endgroup$
$begingroup$
You can move theL/n
to the footer, so it's actually 220 bytes. Can more bytes be saved by porting the 05AB1E / Java answers (using this compressed integer, convert it to base-3, and replace all2
s with0000
s)?
$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen nice catch! I wish I had more string replacement functions, but that's not part of MathGolf right now.
$endgroup$
– maxb
2 days ago
$begingroup$
How about a map per digit, which maps2
to♫░╞
? EDIT: Never mind. I see you don't have a Base Conversion builtin (except for binary/hexadecimal) to convert to base-3?
$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen I have thought a bit on how I should change the base conversion. I certainly don't need one command for converting binary string to decimal, and another for converting a binary array to decimal. That way, I can fit another base conversion command in (and the idea has always been to have general base conversion in the language).
$endgroup$
– maxb
11 hours ago
add a comment |
$begingroup$
MathGolf, 223 220 bytes
'06*"x·<×J× Ç×►B×ê"@$↕!◙è0♥f░×→0×♠p└☺α?×└•×◙×P♣p¬è:×►∟××××←♦♠♣≥â☻┘A☺▄αp⌂r☻[║►×>◘×♦♦└:☻↑`×♥@@@@►►@♦↑ ☻♀◘☻♦☻☻├×å↑×╠×Ç!♠ 0♀◘↑◘☻♦◘×♠α♥â▼ÇA×└×◘` ×××▀≈}═14♦►►π0♀××°×α•×►×××☻×◘××└≈}_├↑♪↓×─0♫♥×××|××*××♪×Ç♠×└×××× ⌐¬╩↕◄○((×T☺"$à+
Try it online!
Explanation
'0 push single character "0"
6* repeat 6 times
"..." push the magic string
$ convert to ordinal
à convert to binary string
+ pop a, b : push(a+b) (add the 6 zeroes)
below is the footer
L/ divide into groups of 23 characters
n join array with newlines into string
$endgroup$
$begingroup$
You can move theL/n
to the footer, so it's actually 220 bytes. Can more bytes be saved by porting the 05AB1E / Java answers (using this compressed integer, convert it to base-3, and replace all2
s with0000
s)?
$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen nice catch! I wish I had more string replacement functions, but that's not part of MathGolf right now.
$endgroup$
– maxb
2 days ago
$begingroup$
How about a map per digit, which maps2
to♫░╞
? EDIT: Never mind. I see you don't have a Base Conversion builtin (except for binary/hexadecimal) to convert to base-3?
$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen I have thought a bit on how I should change the base conversion. I certainly don't need one command for converting binary string to decimal, and another for converting a binary array to decimal. That way, I can fit another base conversion command in (and the idea has always been to have general base conversion in the language).
$endgroup$
– maxb
11 hours ago
add a comment |
$begingroup$
MathGolf, 223 220 bytes
'06*"x·<×J× Ç×►B×ê"@$↕!◙è0♥f░×→0×♠p└☺α?×└•×◙×P♣p¬è:×►∟××××←♦♠♣≥â☻┘A☺▄αp⌂r☻[║►×>◘×♦♦└:☻↑`×♥@@@@►►@♦↑ ☻♀◘☻♦☻☻├×å↑×╠×Ç!♠ 0♀◘↑◘☻♦◘×♠α♥â▼ÇA×└×◘` ×××▀≈}═14♦►►π0♀××°×α•×►×××☻×◘××└≈}_├↑♪↓×─0♫♥×××|××*××♪×Ç♠×└×××× ⌐¬╩↕◄○((×T☺"$à+
Try it online!
Explanation
'0 push single character "0"
6* repeat 6 times
"..." push the magic string
$ convert to ordinal
à convert to binary string
+ pop a, b : push(a+b) (add the 6 zeroes)
below is the footer
L/ divide into groups of 23 characters
n join array with newlines into string
$endgroup$
MathGolf, 223 220 bytes
'06*"x·<×J× Ç×►B×ê"@$↕!◙è0♥f░×→0×♠p└☺α?×└•×◙×P♣p¬è:×►∟××××←♦♠♣≥â☻┘A☺▄αp⌂r☻[║►×>◘×♦♦└:☻↑`×♥@@@@►►@♦↑ ☻♀◘☻♦☻☻├×å↑×╠×Ç!♠ 0♀◘↑◘☻♦◘×♠α♥â▼ÇA×└×◘` ×××▀≈}═14♦►►π0♀××°×α•×►×××☻×◘××└≈}_├↑♪↓×─0♫♥×××|××*××♪×Ç♠×└×××× ⌐¬╩↕◄○((×T☺"$à+
Try it online!
Explanation
'0 push single character "0"
6* repeat 6 times
"..." push the magic string
$ convert to ordinal
à convert to binary string
+ pop a, b : push(a+b) (add the 6 zeroes)
below is the footer
L/ divide into groups of 23 characters
n join array with newlines into string
edited 2 days ago
answered 2 days ago
maxbmaxb
3,34311232
3,34311232
$begingroup$
You can move theL/n
to the footer, so it's actually 220 bytes. Can more bytes be saved by porting the 05AB1E / Java answers (using this compressed integer, convert it to base-3, and replace all2
s with0000
s)?
$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen nice catch! I wish I had more string replacement functions, but that's not part of MathGolf right now.
$endgroup$
– maxb
2 days ago
$begingroup$
How about a map per digit, which maps2
to♫░╞
? EDIT: Never mind. I see you don't have a Base Conversion builtin (except for binary/hexadecimal) to convert to base-3?
$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen I have thought a bit on how I should change the base conversion. I certainly don't need one command for converting binary string to decimal, and another for converting a binary array to decimal. That way, I can fit another base conversion command in (and the idea has always been to have general base conversion in the language).
$endgroup$
– maxb
11 hours ago
add a comment |
$begingroup$
You can move theL/n
to the footer, so it's actually 220 bytes. Can more bytes be saved by porting the 05AB1E / Java answers (using this compressed integer, convert it to base-3, and replace all2
s with0000
s)?
$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen nice catch! I wish I had more string replacement functions, but that's not part of MathGolf right now.
$endgroup$
– maxb
2 days ago
$begingroup$
How about a map per digit, which maps2
to♫░╞
? EDIT: Never mind. I see you don't have a Base Conversion builtin (except for binary/hexadecimal) to convert to base-3?
$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen I have thought a bit on how I should change the base conversion. I certainly don't need one command for converting binary string to decimal, and another for converting a binary array to decimal. That way, I can fit another base conversion command in (and the idea has always been to have general base conversion in the language).
$endgroup$
– maxb
11 hours ago
$begingroup$
You can move the
L/n
to the footer, so it's actually 220 bytes. Can more bytes be saved by porting the 05AB1E / Java answers (using this compressed integer, convert it to base-3, and replace all 2
s with 0000
s)?$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
You can move the
L/n
to the footer, so it's actually 220 bytes. Can more bytes be saved by porting the 05AB1E / Java answers (using this compressed integer, convert it to base-3, and replace all 2
s with 0000
s)?$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen nice catch! I wish I had more string replacement functions, but that's not part of MathGolf right now.
$endgroup$
– maxb
2 days ago
$begingroup$
@KevinCruijssen nice catch! I wish I had more string replacement functions, but that's not part of MathGolf right now.
$endgroup$
– maxb
2 days ago
$begingroup$
How about a map per digit, which maps
2
to ♫░╞
? EDIT: Never mind. I see you don't have a Base Conversion builtin (except for binary/hexadecimal) to convert to base-3?$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
How about a map per digit, which maps
2
to ♫░╞
? EDIT: Never mind. I see you don't have a Base Conversion builtin (except for binary/hexadecimal) to convert to base-3?$endgroup$
– Kevin Cruijssen
2 days ago
$begingroup$
@KevinCruijssen I have thought a bit on how I should change the base conversion. I certainly don't need one command for converting binary string to decimal, and another for converting a binary array to decimal. That way, I can fit another base conversion command in (and the idea has always been to have general base conversion in the language).
$endgroup$
– maxb
11 hours ago
$begingroup$
@KevinCruijssen I have thought a bit on how I should change the base conversion. I certainly don't need one command for converting binary string to decimal, and another for converting a binary array to decimal. That way, I can fit another base conversion command in (and the idea has always been to have general base conversion in the language).
$endgroup$
– maxb
11 hours ago
add a comment |
$begingroup$
Python 2, 336 bytes
print bin(int('gVQAKCgJERLKqqkgAAAAAMAABoAADQAAKgAAfAAAAAMOMMQAGQ0Yw19998AAAAgAAgAAABAAB+AA+AAADDDjEBAENDHNffffAAAAIGAIAMAAQYAfgwPgBgAIBAIIGAgMMCAGIYAAzAAYhgDDAgIEAggMAiAYBEAQEEBAQEADAGAYAjrABAQACD4AELpbAnJ/cODcAUHZAoPyBQYEGwAAAAAcEAA6iqpwBVAACgAHwAA/4AHAcAYAMBoAsGYDMIoKIRIkQCKIAEIQAIAgAEoAPPp4'.decode('base64').encode('hex'),16))[3:]
Try it online!
Prints a string of bytes
$endgroup$
add a comment |
$begingroup$
Python 2, 336 bytes
print bin(int('gVQAKCgJERLKqqkgAAAAAMAABoAADQAAKgAAfAAAAAMOMMQAGQ0Yw19998AAAAgAAgAAABAAB+AA+AAADDDjEBAENDHNffffAAAAIGAIAMAAQYAfgwPgBgAIBAIIGAgMMCAGIYAAzAAYhgDDAgIEAggMAiAYBEAQEEBAQEADAGAYAjrABAQACD4AELpbAnJ/cODcAUHZAoPyBQYEGwAAAAAcEAA6iqpwBVAACgAHwAA/4AHAcAYAMBoAsGYDMIoKIRIkQCKIAEIQAIAgAEoAPPp4'.decode('base64').encode('hex'),16))[3:]
Try it online!
Prints a string of bytes
$endgroup$
add a comment |
$begingroup$
Python 2, 336 bytes
print bin(int('gVQAKCgJERLKqqkgAAAAAMAABoAADQAAKgAAfAAAAAMOMMQAGQ0Yw19998AAAAgAAgAAABAAB+AA+AAADDDjEBAENDHNffffAAAAIGAIAMAAQYAfgwPgBgAIBAIIGAgMMCAGIYAAzAAYhgDDAgIEAggMAiAYBEAQEEBAQEADAGAYAjrABAQACD4AELpbAnJ/cODcAUHZAoPyBQYEGwAAAAAcEAA6iqpwBVAACgAHwAA/4AHAcAYAMBoAsGYDMIoKIRIkQCKIAEIQAIAgAEoAPPp4'.decode('base64').encode('hex'),16))[3:]
Try it online!
Prints a string of bytes
$endgroup$
Python 2, 336 bytes
print bin(int('gVQAKCgJERLKqqkgAAAAAMAABoAADQAAKgAAfAAAAAMOMMQAGQ0Yw19998AAAAgAAgAAABAAB+AA+AAADDDjEBAENDHNffffAAAAIGAIAMAAQYAfgwPgBgAIBAIIGAgMMCAGIYAAzAAYhgDDAgIEAggMAiAYBEAQEEBAQEADAGAYAjrABAQACD4AELpbAnJ/cODcAUHZAoPyBQYEGwAAAAAcEAA6iqpwBVAACgAHwAA/4AHAcAYAMBoAsGYDMIoKIRIkQCKIAEIQAIAgAEoAPPp4'.decode('base64').encode('hex'),16))[3:]
Try it online!
Prints a string of bytes
answered Apr 10 at 7:06
TFeldTFeld
16.5k21451
16.5k21451
add a comment |
add a comment |
$begingroup$
Bash, 702 697 bytes
xxd -r -p<<X|xz -dc
fd377a585a000004e6d6b4460200210116000000742fe5a3e006d7010c5d
0018698865079cf6752c9e9a501a87a798b4844f9fcfdaaf87733b9d8239
48c816d860a938767f6cb81299f3e8a638effe3068c0e096a8949c81d706
7dff3ec44e5df185b3a48e5b5857724386e8c37cfbd5c856b12614ee78ec
c41df4db3aea71fd3a8fa474905609f78eb3fd66e246557965e4ab6dfd67
efbd9202f542ded9cf98a6401ee2d23afb2f544bd2442c6f428fd612397c
f2c6ec50847ddccc5832185e487712e5a7676b97058d7e485d5a3536166a
44ab3c689c93073cdda73b5306a83c4cd268e79db238bfa2d08ac912a578
75020bc7828342d5a62ce367aff7fd89290336128d119fa4272da2b2a79f
5973c71935af054f2d91c1bd3ea4847a3502d6dc8c975114dacf8a4de600
622d80986dbb0cd00001a802d80d00001b16e2a7b1c467fb020000000004
595a
X
Try it online!
$endgroup$
add a comment |
$begingroup$
Bash, 702 697 bytes
xxd -r -p<<X|xz -dc
fd377a585a000004e6d6b4460200210116000000742fe5a3e006d7010c5d
0018698865079cf6752c9e9a501a87a798b4844f9fcfdaaf87733b9d8239
48c816d860a938767f6cb81299f3e8a638effe3068c0e096a8949c81d706
7dff3ec44e5df185b3a48e5b5857724386e8c37cfbd5c856b12614ee78ec
c41df4db3aea71fd3a8fa474905609f78eb3fd66e246557965e4ab6dfd67
efbd9202f542ded9cf98a6401ee2d23afb2f544bd2442c6f428fd612397c
f2c6ec50847ddccc5832185e487712e5a7676b97058d7e485d5a3536166a
44ab3c689c93073cdda73b5306a83c4cd268e79db238bfa2d08ac912a578
75020bc7828342d5a62ce367aff7fd89290336128d119fa4272da2b2a79f
5973c71935af054f2d91c1bd3ea4847a3502d6dc8c975114dacf8a4de600
622d80986dbb0cd00001a802d80d00001b16e2a7b1c467fb020000000004
595a
X
Try it online!
$endgroup$
add a comment |
$begingroup$
Bash, 702 697 bytes
xxd -r -p<<X|xz -dc
fd377a585a000004e6d6b4460200210116000000742fe5a3e006d7010c5d
0018698865079cf6752c9e9a501a87a798b4844f9fcfdaaf87733b9d8239
48c816d860a938767f6cb81299f3e8a638effe3068c0e096a8949c81d706
7dff3ec44e5df185b3a48e5b5857724386e8c37cfbd5c856b12614ee78ec
c41df4db3aea71fd3a8fa474905609f78eb3fd66e246557965e4ab6dfd67
efbd9202f542ded9cf98a6401ee2d23afb2f544bd2442c6f428fd612397c
f2c6ec50847ddccc5832185e487712e5a7676b97058d7e485d5a3536166a
44ab3c689c93073cdda73b5306a83c4cd268e79db238bfa2d08ac912a578
75020bc7828342d5a62ce367aff7fd89290336128d119fa4272da2b2a79f
5973c71935af054f2d91c1bd3ea4847a3502d6dc8c975114dacf8a4de600
622d80986dbb0cd00001a802d80d00001b16e2a7b1c467fb020000000004
595a
X
Try it online!
$endgroup$
Bash, 702 697 bytes
xxd -r -p<<X|xz -dc
fd377a585a000004e6d6b4460200210116000000742fe5a3e006d7010c5d
0018698865079cf6752c9e9a501a87a798b4844f9fcfdaaf87733b9d8239
48c816d860a938767f6cb81299f3e8a638effe3068c0e096a8949c81d706
7dff3ec44e5df185b3a48e5b5857724386e8c37cfbd5c856b12614ee78ec
c41df4db3aea71fd3a8fa474905609f78eb3fd66e246557965e4ab6dfd67
efbd9202f542ded9cf98a6401ee2d23afb2f544bd2442c6f428fd612397c
f2c6ec50847ddccc5832185e487712e5a7676b97058d7e485d5a3536166a
44ab3c689c93073cdda73b5306a83c4cd268e79db238bfa2d08ac912a578
75020bc7828342d5a62ce367aff7fd89290336128d119fa4272da2b2a79f
5973c71935af054f2d91c1bd3ea4847a3502d6dc8c975114dacf8a4de600
622d80986dbb0cd00001a802d80d00001b16e2a7b1c467fb020000000004
595a
X
Try it online!
edited Apr 10 at 13:34
answered Apr 10 at 13:19
Noodle9Noodle9
30137
30137
add a comment |
add a comment |
$begingroup$
Ruby, 362 bytes
puts"5r0afnfm8wyke8tfy1pwt7xnuaxyh3wodfp7bhsdufyw0xbdp1pumrz2xir652tuc0ss9oec8yad9vefivd66j126wybhefgk2lv38uqqiur11u26q275jk3h2ucithd59awpaenqpqi1pszh52179zw0ddqtbrvo6kyrrgv8c34pqrp83j8estjp63v29t4hqp9yg2hhzjlq1e9zqx6gh20n9lsttimz3nbq060ritrphxaru7quwmv3oujhd9xjddpbacq4bnpf270znhgto59yn0980itylf95pxw9x7rvkvi7mfql1sx46puo8rg4dq0".to_i(36).to_s(2).rjust(1679,?0)
Integer written in base 36. There's surely a more efficient way to compress the integer, e.g. with zlib
or base64
.
Try it online!
$endgroup$
add a comment |
$begingroup$
Ruby, 362 bytes
puts"5r0afnfm8wyke8tfy1pwt7xnuaxyh3wodfp7bhsdufyw0xbdp1pumrz2xir652tuc0ss9oec8yad9vefivd66j126wybhefgk2lv38uqqiur11u26q275jk3h2ucithd59awpaenqpqi1pszh52179zw0ddqtbrvo6kyrrgv8c34pqrp83j8estjp63v29t4hqp9yg2hhzjlq1e9zqx6gh20n9lsttimz3nbq060ritrphxaru7quwmv3oujhd9xjddpbacq4bnpf270znhgto59yn0980itylf95pxw9x7rvkvi7mfql1sx46puo8rg4dq0".to_i(36).to_s(2).rjust(1679,?0)
Integer written in base 36. There's surely a more efficient way to compress the integer, e.g. with zlib
or base64
.
Try it online!
$endgroup$
add a comment |
$begingroup$
Ruby, 362 bytes
puts"5r0afnfm8wyke8tfy1pwt7xnuaxyh3wodfp7bhsdufyw0xbdp1pumrz2xir652tuc0ss9oec8yad9vefivd66j126wybhefgk2lv38uqqiur11u26q275jk3h2ucithd59awpaenqpqi1pszh52179zw0ddqtbrvo6kyrrgv8c34pqrp83j8estjp63v29t4hqp9yg2hhzjlq1e9zqx6gh20n9lsttimz3nbq060ritrphxaru7quwmv3oujhd9xjddpbacq4bnpf270znhgto59yn0980itylf95pxw9x7rvkvi7mfql1sx46puo8rg4dq0".to_i(36).to_s(2).rjust(1679,?0)
Integer written in base 36. There's surely a more efficient way to compress the integer, e.g. with zlib
or base64
.
Try it online!
$endgroup$
Ruby, 362 bytes
puts"5r0afnfm8wyke8tfy1pwt7xnuaxyh3wodfp7bhsdufyw0xbdp1pumrz2xir652tuc0ss9oec8yad9vefivd66j126wybhefgk2lv38uqqiur11u26q275jk3h2ucithd59awpaenqpqi1pszh52179zw0ddqtbrvo6kyrrgv8c34pqrp83j8estjp63v29t4hqp9yg2hhzjlq1e9zqx6gh20n9lsttimz3nbq060ritrphxaru7quwmv3oujhd9xjddpbacq4bnpf270znhgto59yn0980itylf95pxw9x7rvkvi7mfql1sx46puo8rg4dq0".to_i(36).to_s(2).rjust(1679,?0)
Integer written in base 36. There's surely a more efficient way to compress the integer, e.g. with zlib
or base64
.
Try it online!
edited Apr 10 at 13:38
answered Apr 10 at 13:29
Eric DuminilEric Duminil
46128
46128
add a comment |
add a comment |
$begingroup$
[C++ (VC++)(but tested with gcc as well)], 585 bytes
#define l(x,y)for(int x=0;x<y;x++)
void f()const char*a="02A800505012Y595Y240U180YD0Y1A0Y540YF80V61C618800321A3186BEFBEF80X10Y40W20YFC001F0X1861C620200868639AFBEFBE0W40C0100180Z83003F0607C00C001008041030101860400C430Z19800310C018604040804101804403008802020808080800600C030047580080800107C002174B604E4FEE1C1B80283B20507E40A0C08360U3820Z751554E00AA0Z140ZF80Z7FC00380E00C0060340160CC06611414422448804510Z8420010040Z940079F4F0";int x=1679;l(i,365)int d=a[i],c=0;d-=(d>47&d<58)?48:((d>64&d<71)?55:0);if(d>70&d<91)c=91-d,d=a[i-1];for(c;c>=0;c--)l(j,4)if(x--)cout<<(int)((d&(8>>j))>0);
Try it online!
ungolfed Version (lacks the break after the 1679th element though and goes until the 1680th):
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
const char arecibo[]="02A800505012Y595Y240U180YD0Y1A0Y540YF80V61C618800321A3186BEFBEF80X10Y40W20YFC001F0X1861C620200868639AFBEFBE0W40C0100180Z83003F0607C00C001008041030101860400C430Z19800310C018604040804101804403008802020808080800600C030047580080800107C002174B604E4FEE1C1B80283B20507E40A0C08360U3820Z751554E00AA0Z140ZF80Z7FC00380E00C0060340160CC06611414422448804510Z8420010040Z940079F4F0";
int i = 0,j;
while (i<sizeof(arecibo)-1)
char digit = arecibo[i];
int count=0;
if (digit >= '0' & digit <= '9')
digit -= '0';
else if (digit>='A'& digit<='F')
digit -= 'A'-10;
else if (digit > 'F'&digit<='Z')
//digit does not contain any valid hex digit in this case
count = 'Z' - digit+1; //digit = Z means repeat 2 more times...
digit = arecibo[i - 1];
for (count; count >= 0; count--)
for (j = 0; j<4; j++)
cout << (int)(((digit)&(8 >> j))>0);
i++;
return 0;
as an Explanation: i concatenated the 73 lines of sample output given to one long line.
i encoded them in hexadecimal where the bit order is msbfirst (using this program https://github.com/Marc-Bender/longBinaryStreamToHex/releases/download/addedErrorCode-4/longBinaryStreamToHex.exe)
i shortened the Output of that by about 70 hexadecimal Digits by using the letters 'G'-'Z' as a sign to repeat the last Digit for a certain amount of times (Z = 2more times, Y = 3more times …)
the rest should be relatively self explainatory for Code-Golfers. abusing the preprocessor to shorten loops, abusing the ,
Operator and the like.
Output Format is uninterrupted stream of 1679 0/1-values.
$endgroup$
$begingroup$
before anybody asks the const is for compatibility with VC++ (what the main development work was done with)
$endgroup$
– der bender
Apr 10 at 21:41
$begingroup$
@ceilingcat i think you can even short that more by pitting your include in the header section...
$endgroup$
– der bender
2 days ago
$begingroup$
557 bytes
$endgroup$
– ceilingcat
22 hours ago
add a comment |
$begingroup$
[C++ (VC++)(but tested with gcc as well)], 585 bytes
#define l(x,y)for(int x=0;x<y;x++)
void f()const char*a="02A800505012Y595Y240U180YD0Y1A0Y540YF80V61C618800321A3186BEFBEF80X10Y40W20YFC001F0X1861C620200868639AFBEFBE0W40C0100180Z83003F0607C00C001008041030101860400C430Z19800310C018604040804101804403008802020808080800600C030047580080800107C002174B604E4FEE1C1B80283B20507E40A0C08360U3820Z751554E00AA0Z140ZF80Z7FC00380E00C0060340160CC06611414422448804510Z8420010040Z940079F4F0";int x=1679;l(i,365)int d=a[i],c=0;d-=(d>47&d<58)?48:((d>64&d<71)?55:0);if(d>70&d<91)c=91-d,d=a[i-1];for(c;c>=0;c--)l(j,4)if(x--)cout<<(int)((d&(8>>j))>0);
Try it online!
ungolfed Version (lacks the break after the 1679th element though and goes until the 1680th):
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
const char arecibo[]="02A800505012Y595Y240U180YD0Y1A0Y540YF80V61C618800321A3186BEFBEF80X10Y40W20YFC001F0X1861C620200868639AFBEFBE0W40C0100180Z83003F0607C00C001008041030101860400C430Z19800310C018604040804101804403008802020808080800600C030047580080800107C002174B604E4FEE1C1B80283B20507E40A0C08360U3820Z751554E00AA0Z140ZF80Z7FC00380E00C0060340160CC06611414422448804510Z8420010040Z940079F4F0";
int i = 0,j;
while (i<sizeof(arecibo)-1)
char digit = arecibo[i];
int count=0;
if (digit >= '0' & digit <= '9')
digit -= '0';
else if (digit>='A'& digit<='F')
digit -= 'A'-10;
else if (digit > 'F'&digit<='Z')
//digit does not contain any valid hex digit in this case
count = 'Z' - digit+1; //digit = Z means repeat 2 more times...
digit = arecibo[i - 1];
for (count; count >= 0; count--)
for (j = 0; j<4; j++)
cout << (int)(((digit)&(8 >> j))>0);
i++;
return 0;
as an Explanation: i concatenated the 73 lines of sample output given to one long line.
i encoded them in hexadecimal where the bit order is msbfirst (using this program https://github.com/Marc-Bender/longBinaryStreamToHex/releases/download/addedErrorCode-4/longBinaryStreamToHex.exe)
i shortened the Output of that by about 70 hexadecimal Digits by using the letters 'G'-'Z' as a sign to repeat the last Digit for a certain amount of times (Z = 2more times, Y = 3more times …)
the rest should be relatively self explainatory for Code-Golfers. abusing the preprocessor to shorten loops, abusing the ,
Operator and the like.
Output Format is uninterrupted stream of 1679 0/1-values.
$endgroup$
$begingroup$
before anybody asks the const is for compatibility with VC++ (what the main development work was done with)
$endgroup$
– der bender
Apr 10 at 21:41
$begingroup$
@ceilingcat i think you can even short that more by pitting your include in the header section...
$endgroup$
– der bender
2 days ago
$begingroup$
557 bytes
$endgroup$
– ceilingcat
22 hours ago
add a comment |
$begingroup$
[C++ (VC++)(but tested with gcc as well)], 585 bytes
#define l(x,y)for(int x=0;x<y;x++)
void f()const char*a="02A800505012Y595Y240U180YD0Y1A0Y540YF80V61C618800321A3186BEFBEF80X10Y40W20YFC001F0X1861C620200868639AFBEFBE0W40C0100180Z83003F0607C00C001008041030101860400C430Z19800310C018604040804101804403008802020808080800600C030047580080800107C002174B604E4FEE1C1B80283B20507E40A0C08360U3820Z751554E00AA0Z140ZF80Z7FC00380E00C0060340160CC06611414422448804510Z8420010040Z940079F4F0";int x=1679;l(i,365)int d=a[i],c=0;d-=(d>47&d<58)?48:((d>64&d<71)?55:0);if(d>70&d<91)c=91-d,d=a[i-1];for(c;c>=0;c--)l(j,4)if(x--)cout<<(int)((d&(8>>j))>0);
Try it online!
ungolfed Version (lacks the break after the 1679th element though and goes until the 1680th):
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
const char arecibo[]="02A800505012Y595Y240U180YD0Y1A0Y540YF80V61C618800321A3186BEFBEF80X10Y40W20YFC001F0X1861C620200868639AFBEFBE0W40C0100180Z83003F0607C00C001008041030101860400C430Z19800310C018604040804101804403008802020808080800600C030047580080800107C002174B604E4FEE1C1B80283B20507E40A0C08360U3820Z751554E00AA0Z140ZF80Z7FC00380E00C0060340160CC06611414422448804510Z8420010040Z940079F4F0";
int i = 0,j;
while (i<sizeof(arecibo)-1)
char digit = arecibo[i];
int count=0;
if (digit >= '0' & digit <= '9')
digit -= '0';
else if (digit>='A'& digit<='F')
digit -= 'A'-10;
else if (digit > 'F'&digit<='Z')
//digit does not contain any valid hex digit in this case
count = 'Z' - digit+1; //digit = Z means repeat 2 more times...
digit = arecibo[i - 1];
for (count; count >= 0; count--)
for (j = 0; j<4; j++)
cout << (int)(((digit)&(8 >> j))>0);
i++;
return 0;
as an Explanation: i concatenated the 73 lines of sample output given to one long line.
i encoded them in hexadecimal where the bit order is msbfirst (using this program https://github.com/Marc-Bender/longBinaryStreamToHex/releases/download/addedErrorCode-4/longBinaryStreamToHex.exe)
i shortened the Output of that by about 70 hexadecimal Digits by using the letters 'G'-'Z' as a sign to repeat the last Digit for a certain amount of times (Z = 2more times, Y = 3more times …)
the rest should be relatively self explainatory for Code-Golfers. abusing the preprocessor to shorten loops, abusing the ,
Operator and the like.
Output Format is uninterrupted stream of 1679 0/1-values.
$endgroup$
[C++ (VC++)(but tested with gcc as well)], 585 bytes
#define l(x,y)for(int x=0;x<y;x++)
void f()const char*a="02A800505012Y595Y240U180YD0Y1A0Y540YF80V61C618800321A3186BEFBEF80X10Y40W20YFC001F0X1861C620200868639AFBEFBE0W40C0100180Z83003F0607C00C001008041030101860400C430Z19800310C018604040804101804403008802020808080800600C030047580080800107C002174B604E4FEE1C1B80283B20507E40A0C08360U3820Z751554E00AA0Z140ZF80Z7FC00380E00C0060340160CC06611414422448804510Z8420010040Z940079F4F0";int x=1679;l(i,365)int d=a[i],c=0;d-=(d>47&d<58)?48:((d>64&d<71)?55:0);if(d>70&d<91)c=91-d,d=a[i-1];for(c;c>=0;c--)l(j,4)if(x--)cout<<(int)((d&(8>>j))>0);
Try it online!
ungolfed Version (lacks the break after the 1679th element though and goes until the 1680th):
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
const char arecibo[]="02A800505012Y595Y240U180YD0Y1A0Y540YF80V61C618800321A3186BEFBEF80X10Y40W20YFC001F0X1861C620200868639AFBEFBE0W40C0100180Z83003F0607C00C001008041030101860400C430Z19800310C018604040804101804403008802020808080800600C030047580080800107C002174B604E4FEE1C1B80283B20507E40A0C08360U3820Z751554E00AA0Z140ZF80Z7FC00380E00C0060340160CC06611414422448804510Z8420010040Z940079F4F0";
int i = 0,j;
while (i<sizeof(arecibo)-1)
char digit = arecibo[i];
int count=0;
if (digit >= '0' & digit <= '9')
digit -= '0';
else if (digit>='A'& digit<='F')
digit -= 'A'-10;
else if (digit > 'F'&digit<='Z')
//digit does not contain any valid hex digit in this case
count = 'Z' - digit+1; //digit = Z means repeat 2 more times...
digit = arecibo[i - 1];
for (count; count >= 0; count--)
for (j = 0; j<4; j++)
cout << (int)(((digit)&(8 >> j))>0);
i++;
return 0;
as an Explanation: i concatenated the 73 lines of sample output given to one long line.
i encoded them in hexadecimal where the bit order is msbfirst (using this program https://github.com/Marc-Bender/longBinaryStreamToHex/releases/download/addedErrorCode-4/longBinaryStreamToHex.exe)
i shortened the Output of that by about 70 hexadecimal Digits by using the letters 'G'-'Z' as a sign to repeat the last Digit for a certain amount of times (Z = 2more times, Y = 3more times …)
the rest should be relatively self explainatory for Code-Golfers. abusing the preprocessor to shorten loops, abusing the ,
Operator and the like.
Output Format is uninterrupted stream of 1679 0/1-values.
answered Apr 10 at 20:38
der benderder bender
212
212
$begingroup$
before anybody asks the const is for compatibility with VC++ (what the main development work was done with)
$endgroup$
– der bender
Apr 10 at 21:41
$begingroup$
@ceilingcat i think you can even short that more by pitting your include in the header section...
$endgroup$
– der bender
2 days ago
$begingroup$
557 bytes
$endgroup$
– ceilingcat
22 hours ago
add a comment |
$begingroup$
before anybody asks the const is for compatibility with VC++ (what the main development work was done with)
$endgroup$
– der bender
Apr 10 at 21:41
$begingroup$
@ceilingcat i think you can even short that more by pitting your include in the header section...
$endgroup$
– der bender
2 days ago
$begingroup$
557 bytes
$endgroup$
– ceilingcat
22 hours ago
$begingroup$
before anybody asks the const is for compatibility with VC++ (what the main development work was done with)
$endgroup$
– der bender
Apr 10 at 21:41
$begingroup$
before anybody asks the const is for compatibility with VC++ (what the main development work was done with)
$endgroup$
– der bender
Apr 10 at 21:41
$begingroup$
@ceilingcat i think you can even short that more by pitting your include in the header section...
$endgroup$
– der bender
2 days ago
$begingroup$
@ceilingcat i think you can even short that more by pitting your include in the header section...
$endgroup$
– der bender
2 days ago
$begingroup$
557 bytes
$endgroup$
– ceilingcat
22 hours ago
$begingroup$
557 bytes
$endgroup$
– ceilingcat
22 hours ago
add a comment |
$begingroup$
Perl 6, 348 bytes
"000000"~:36<5r0afnfm8wyke8tfy1pwt7xnuaxyh3wodfp7bhsdufyw0xbdp1pumrz2xir652tuc0ss9oec8yad9vefivd66j126wybhefgk2lv38uqqiur11u26q275jk3h2ucithd59awpaenqpqi1pszh52179zw0ddqtbrvo6kyrrgv8c34pqrp83j8estjp63v29t4hqp9yg2hhzjlq1e9zqx6gh20n9lsttimz3nbq060ritrphxaru7quwmv3oujhd9xjddpbacq4bnpf270znhgto59yn0980itylf95pxw9x7rvkvi7mfql1sx46puo8rg4dq0>.base(2)
Based on Benjamin Urquhart's Java solution.
Uses a straight stream of 0 and 1 characters. The link below has some code to prettify the output.
Try it online!
$endgroup$
add a comment |
$begingroup$
Perl 6, 348 bytes
"000000"~:36<5r0afnfm8wyke8tfy1pwt7xnuaxyh3wodfp7bhsdufyw0xbdp1pumrz2xir652tuc0ss9oec8yad9vefivd66j126wybhefgk2lv38uqqiur11u26q275jk3h2ucithd59awpaenqpqi1pszh52179zw0ddqtbrvo6kyrrgv8c34pqrp83j8estjp63v29t4hqp9yg2hhzjlq1e9zqx6gh20n9lsttimz3nbq060ritrphxaru7quwmv3oujhd9xjddpbacq4bnpf270znhgto59yn0980itylf95pxw9x7rvkvi7mfql1sx46puo8rg4dq0>.base(2)
Based on Benjamin Urquhart's Java solution.
Uses a straight stream of 0 and 1 characters. The link below has some code to prettify the output.
Try it online!
$endgroup$
add a comment |
$begingroup$
Perl 6, 348 bytes
"000000"~:36<5r0afnfm8wyke8tfy1pwt7xnuaxyh3wodfp7bhsdufyw0xbdp1pumrz2xir652tuc0ss9oec8yad9vefivd66j126wybhefgk2lv38uqqiur11u26q275jk3h2ucithd59awpaenqpqi1pszh52179zw0ddqtbrvo6kyrrgv8c34pqrp83j8estjp63v29t4hqp9yg2hhzjlq1e9zqx6gh20n9lsttimz3nbq060ritrphxaru7quwmv3oujhd9xjddpbacq4bnpf270znhgto59yn0980itylf95pxw9x7rvkvi7mfql1sx46puo8rg4dq0>.base(2)
Based on Benjamin Urquhart's Java solution.
Uses a straight stream of 0 and 1 characters. The link below has some code to prettify the output.
Try it online!
$endgroup$
Perl 6, 348 bytes
"000000"~:36<5r0afnfm8wyke8tfy1pwt7xnuaxyh3wodfp7bhsdufyw0xbdp1pumrz2xir652tuc0ss9oec8yad9vefivd66j126wybhefgk2lv38uqqiur11u26q275jk3h2ucithd59awpaenqpqi1pszh52179zw0ddqtbrvo6kyrrgv8c34pqrp83j8estjp63v29t4hqp9yg2hhzjlq1e9zqx6gh20n9lsttimz3nbq060ritrphxaru7quwmv3oujhd9xjddpbacq4bnpf270znhgto59yn0980itylf95pxw9x7rvkvi7mfql1sx46puo8rg4dq0>.base(2)
Based on Benjamin Urquhart's Java solution.
Uses a straight stream of 0 and 1 characters. The link below has some code to prettify the output.
Try it online!
answered Apr 11 at 3:23
bb94bb94
1,094711
1,094711
add a comment |
add a comment |
$begingroup$
Piet, 1763 codels
Outputs a stream of 0s and 1s (no line breaks).
Codel size 1:
Codel size 4, for easier viewing:
Explanation
- First, push a sentinel value of -1 onto the stack.
- Then push the Arecibo message, in reverse order (because it's a stack), using run-length encoding.
- Finally, alternate between two loops, one printing zeroes and the other printing ones.
- The loop counter is the current stack value, decremented until it hits zero, at which point it is discarded and we switch to the other loop.
- Between the zeroes-loop and the ones-loop, check for the sentinel value, exiting if it is found.
Notes
The program follows a spiral path, clockwise from top left into the centre. The scattered black blocks that roughly follow the diagonals are the flow control. Here's the trace from NPiet.
I've been working on this since the day this challenge went up, but it took a little bit of time to get the message "written" into the picture! I wrote the final loops and the sentinel value first, and then built up the message from the centre outwards. (Since Piet always starts execution from the top left, I expected to have to shuffle and rotate the image around to avoid excess whitespace, but it fit perfectly!)
Fun fact: Run-length encoding in Piet doesn't (by itself) save any space. It takes n codels of one colour to push the value n onto the stack, or n codels of different colours to push that many 1s onto the stack. So it's the same number of codels either way. But the bigger numbers that RLE gives you mean you can use arithmetic tricks (e.g. instead of pushing 9, you can push 3, duplicate, and multiply) to reduce the number of codels, and funny-shaped blocks to fill in available whitespace.
I wasn't sure about how to count score for Piet entries. I found some that seem to count all codels, and others that explicitly only count those actively used. I just counted them all; ignoring white codels (even those that the program never moves through) seems akin to ignoring whitespace in a more typical programming language.
Oh, and I've just now (two hours after posting) realised that I wasted the last bit of time working on this. I wanted to trim off the almost-completely-white last row and column, so I shuffled things around... including the black flow-control blocks. But the edges of the image work the same as black! If I'd just remembered that, I wouldn't have needed to spend so much time puzzling over the intricacies of DPs and CCs...
$endgroup$
add a comment |
$begingroup$
Piet, 1763 codels
Outputs a stream of 0s and 1s (no line breaks).
Codel size 1:
Codel size 4, for easier viewing:
Explanation
- First, push a sentinel value of -1 onto the stack.
- Then push the Arecibo message, in reverse order (because it's a stack), using run-length encoding.
- Finally, alternate between two loops, one printing zeroes and the other printing ones.
- The loop counter is the current stack value, decremented until it hits zero, at which point it is discarded and we switch to the other loop.
- Between the zeroes-loop and the ones-loop, check for the sentinel value, exiting if it is found.
Notes
The program follows a spiral path, clockwise from top left into the centre. The scattered black blocks that roughly follow the diagonals are the flow control. Here's the trace from NPiet.
I've been working on this since the day this challenge went up, but it took a little bit of time to get the message "written" into the picture! I wrote the final loops and the sentinel value first, and then built up the message from the centre outwards. (Since Piet always starts execution from the top left, I expected to have to shuffle and rotate the image around to avoid excess whitespace, but it fit perfectly!)
Fun fact: Run-length encoding in Piet doesn't (by itself) save any space. It takes n codels of one colour to push the value n onto the stack, or n codels of different colours to push that many 1s onto the stack. So it's the same number of codels either way. But the bigger numbers that RLE gives you mean you can use arithmetic tricks (e.g. instead of pushing 9, you can push 3, duplicate, and multiply) to reduce the number of codels, and funny-shaped blocks to fill in available whitespace.
I wasn't sure about how to count score for Piet entries. I found some that seem to count all codels, and others that explicitly only count those actively used. I just counted them all; ignoring white codels (even those that the program never moves through) seems akin to ignoring whitespace in a more typical programming language.
Oh, and I've just now (two hours after posting) realised that I wasted the last bit of time working on this. I wanted to trim off the almost-completely-white last row and column, so I shuffled things around... including the black flow-control blocks. But the edges of the image work the same as black! If I'd just remembered that, I wouldn't have needed to spend so much time puzzling over the intricacies of DPs and CCs...
$endgroup$
add a comment |
$begingroup$
Piet, 1763 codels
Outputs a stream of 0s and 1s (no line breaks).
Codel size 1:
Codel size 4, for easier viewing:
Explanation
- First, push a sentinel value of -1 onto the stack.
- Then push the Arecibo message, in reverse order (because it's a stack), using run-length encoding.
- Finally, alternate between two loops, one printing zeroes and the other printing ones.
- The loop counter is the current stack value, decremented until it hits zero, at which point it is discarded and we switch to the other loop.
- Between the zeroes-loop and the ones-loop, check for the sentinel value, exiting if it is found.
Notes
The program follows a spiral path, clockwise from top left into the centre. The scattered black blocks that roughly follow the diagonals are the flow control. Here's the trace from NPiet.
I've been working on this since the day this challenge went up, but it took a little bit of time to get the message "written" into the picture! I wrote the final loops and the sentinel value first, and then built up the message from the centre outwards. (Since Piet always starts execution from the top left, I expected to have to shuffle and rotate the image around to avoid excess whitespace, but it fit perfectly!)
Fun fact: Run-length encoding in Piet doesn't (by itself) save any space. It takes n codels of one colour to push the value n onto the stack, or n codels of different colours to push that many 1s onto the stack. So it's the same number of codels either way. But the bigger numbers that RLE gives you mean you can use arithmetic tricks (e.g. instead of pushing 9, you can push 3, duplicate, and multiply) to reduce the number of codels, and funny-shaped blocks to fill in available whitespace.
I wasn't sure about how to count score for Piet entries. I found some that seem to count all codels, and others that explicitly only count those actively used. I just counted them all; ignoring white codels (even those that the program never moves through) seems akin to ignoring whitespace in a more typical programming language.
Oh, and I've just now (two hours after posting) realised that I wasted the last bit of time working on this. I wanted to trim off the almost-completely-white last row and column, so I shuffled things around... including the black flow-control blocks. But the edges of the image work the same as black! If I'd just remembered that, I wouldn't have needed to spend so much time puzzling over the intricacies of DPs and CCs...
$endgroup$
Piet, 1763 codels
Outputs a stream of 0s and 1s (no line breaks).
Codel size 1:
Codel size 4, for easier viewing:
Explanation
- First, push a sentinel value of -1 onto the stack.
- Then push the Arecibo message, in reverse order (because it's a stack), using run-length encoding.
- Finally, alternate between two loops, one printing zeroes and the other printing ones.
- The loop counter is the current stack value, decremented until it hits zero, at which point it is discarded and we switch to the other loop.
- Between the zeroes-loop and the ones-loop, check for the sentinel value, exiting if it is found.
Notes
The program follows a spiral path, clockwise from top left into the centre. The scattered black blocks that roughly follow the diagonals are the flow control. Here's the trace from NPiet.
I've been working on this since the day this challenge went up, but it took a little bit of time to get the message "written" into the picture! I wrote the final loops and the sentinel value first, and then built up the message from the centre outwards. (Since Piet always starts execution from the top left, I expected to have to shuffle and rotate the image around to avoid excess whitespace, but it fit perfectly!)
Fun fact: Run-length encoding in Piet doesn't (by itself) save any space. It takes n codels of one colour to push the value n onto the stack, or n codels of different colours to push that many 1s onto the stack. So it's the same number of codels either way. But the bigger numbers that RLE gives you mean you can use arithmetic tricks (e.g. instead of pushing 9, you can push 3, duplicate, and multiply) to reduce the number of codels, and funny-shaped blocks to fill in available whitespace.
I wasn't sure about how to count score for Piet entries. I found some that seem to count all codels, and others that explicitly only count those actively used. I just counted them all; ignoring white codels (even those that the program never moves through) seems akin to ignoring whitespace in a more typical programming language.
Oh, and I've just now (two hours after posting) realised that I wasted the last bit of time working on this. I wanted to trim off the almost-completely-white last row and column, so I shuffled things around... including the black flow-control blocks. But the edges of the image work the same as black! If I'd just remembered that, I wouldn't have needed to spend so much time puzzling over the intricacies of DPs and CCs...
edited 8 hours ago
answered 10 hours ago
Tim PederickTim Pederick
1,041710
1,041710
add a comment |
add a comment |
If this is an answer to a challenge…
…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.
…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.
More generally…
…Please make sure to answer the question and provide sufficient detail.
…Avoid asking for help, clarification or responding to other answers (use comments instead).
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f182924%2foutput-the-arecibo-message%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
9
$begingroup$
If a language has a built in for Arecibo message, I can tell, with all certainty, that I've seen everything in this world c:
$endgroup$
– Luis felipe De jesus Munoz
Apr 9 at 18:04
6
$begingroup$
Mathematica (IIRC) has an image builtin for Lena, so it wouldn't surprise me if it also has an Aricebo message as well.
$endgroup$
– Beefster
Apr 9 at 18:06
$begingroup$
@RobertS. no because there are other valid formats besides text.
$endgroup$
– Beefster
Apr 9 at 18:27
3
$begingroup$
In the spirit of the original format, a flat result/output should be allowed. The whole point of 1679 bits is exactly that the proper number of rows and columns can be inferred from the signal length.
$endgroup$
– Adám
Apr 9 at 19:10
4
$begingroup$
@LuisfelipeDejesusMunoz Mathematica has a builtin to determine goats in a picture, so an Arecibo message builtin wouldn't really surprise me either.. That language is built on builtins of the universe.. >.>
$endgroup$
– Kevin Cruijssen
Apr 10 at 6:47