69
\$\begingroup\$

This is the PPCG Prime

624 digits long

777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777111111111111111111111111111111111111111111111111111111111111111111111111111111188888888118888888811188888811188888811188111118818811111881881111881881111881188111118818811111881881111111881111111188888888118888888811881111111881118888188111111118811111111881111111881111881188111111118811111111881111881881111881188111111118811111111188888811188888811111111111111111111111111111111111111111111111111111111111111111111111111111111333333333333333333333333333333333333333



If we split every 39 digits we get

777777777777777777777777777777777777777
777777777777777777777777777777777777777
777777777777777777777777777777777777777
777777777777777777777777777777777777777
111111111111111111111111111111111111111
111111111111111111111111111111111111111
188888888118888888811188888811188888811
188111118818811111881881111881881111881
188111118818811111881881111111881111111
188888888118888888811881111111881118888
188111111118811111111881111111881111881
188111111118811111111881111881881111881
188111111118811111111188888811188888811
111111111111111111111111111111111111111
111111111111111111111111111111111111111
333333333333333333333333333333333333333

Your task is to output the PPCG-Prime

This is .Shortest code in bytes wins.

If you input the PPCG-Prime in the Mathematica function below, you get this result

ArrayPlot@Partition[IntegerDigits@#,39]&   

enter image description here

\$\endgroup\$
  • 37
    \$\begingroup\$ How on earth did you find this? \$\endgroup\$ – Stewie Griffin Oct 23 '17 at 6:38
  • 5
    \$\begingroup\$ @StewieGriffin The average probability for a number n to be prime is proportional to 1/log(n), which is not very small, anyway. Just check a lot of numbers until it's prime. \$\endgroup\$ – user202729 Oct 23 '17 at 6:40
  • 2
    \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$ – Dennis Oct 23 '17 at 12:51
  • 1
    \$\begingroup\$ @user202729 log(n) is about 1436.6 in this case. \$\endgroup\$ – Jeppe Stig Nielsen Oct 24 '17 at 21:25
  • 3
    \$\begingroup\$ @Fabian I don't think this method would be efficient... For a Prime this big (624 digits), the number you are asking has 621 digits (and is even more difficult to golf), Unless this is the 10^621th prime!!! If you want to find your number, here is a simple approximation x/logx by Gauss \$\endgroup\$ – user72253 Oct 25 '17 at 13:31

23 Answers 23

22
\$\begingroup\$

Jelly, 55 54 52 47 46 bytes

“=÷¡v⁺ʋiṂYR¤"bİɲ}Ñ1Ṇ⁴ẠV⁹yȥGẇ’“¿mŻ“p’Dx39jBo88V

There are more convoluted approaches in the revision history, but this simple one beats them all.

Try it online!

How it works

“=÷¡v⁺ʋiṂYR¤"bİɲ}Ñ1Ṇ⁴ẠV⁹yȥGẇ’

This is a numeric literal, encoded in bijective base 250, where the digits are taken from Jelly's code page. The chain's (left) argument and the return value are set to the encoded integer,
n := 0x21871c77d7d7af6fafafeff0c37f72ff7fbfbdbfdfef5edfeff8e3.

“¿mŻ“p’

A similar literal to the above one, but the second separates two encoded integers. The return value is replaced with the encoded array, [777711, 113].

Dx39

D converts the return value to decimal ([[7, 7, 7, 7, 1, 1], [1, 1, 3]]), then x39 repeats each individual integer/digit in the result 39 times. This yields a pair of arrays, which contains the digits before and after the 7-character high text, respectively. Let's call this array A.

jB

First, B converts the (left) argument n to binary. This yields the digits that form the 7-character high text, where each 88 has been replaced by 0.

Then, j joins the array A, using the binary array as separator.

o88

This performs logical OR with 88, replacing each 0 with 88.

V

We have the correct digits now, but in an array of 7's, 1's, 88's, and 3's. V implicitly turns this array into a string and then evals it, yielding a single integer.

\$\endgroup\$
6
\$\begingroup\$

Bubblegum, 51 bytes

00000000: 331f c4c0 90ba c002 0a90 5986 d818 50d5  3.........Y...P.
00000010: 282c 3406 6e65 5036 1e4b 9195 8109 649d  (,4.neP6.K....d.
00000020: 5858 1896 4279 68b2 f895 61fa 94ca c098  XX..Byh...a.....
00000030: 3800 00                                  8..

Try it online!

\$\endgroup\$
6
\$\begingroup\$

SOGL V0.12, 52 51 bytes

≡=vā⁷H↕↕jΥ_Ν↑∆∫▲pΖo	‘θδžΟwd╬2n?q[‘²Κ7n⌡"α¼■╤ģ⅞¹‘¹H∑

ties bubblegum!
note that this answer contains a tab

Try it Here!

Tries to save bytes by reusing the same string for both of the Ps.

Explanation:

...‘...‘²Κ7n⌡"..‘¹H∑  compressed strings replaced with ellipses to shorten the width
...‘                  pushes "1111111188888188888888111118811111881111188111118881118818111811111111188888188888888111118811111881111188118118888818818881811118111" - CG
    ...‘              pushes "1111111888888888888881118118111811811181181118118111811811188881111881" - P
        ²             join with itself - double the P
         Κ            reverse add - prepend the PP to CG
          7n          split to line lengths of 7
            ⌡         for each
             "..‘       push "311ŗ117777" with ŗ replaced with the ToS - current item looping over
                 ¹    wrap the results tn an array
                  H   rotate it counter-clockwise
                   ∑  join to a single string

The numbers there are saved as from the original starting at the bottom left, going up, then 1 right & down, then up, ect.

A 52 byte plain compression version:

#⅓→9E■Ν►1&⅝θ⅞%øøμ←N═]y)u⅝↓$A○░(ZF16Φ⅓Mč▓d⅛Hι‼∑υnη▲Z‘

Try it Here!

\$\endgroup\$
  • \$\begingroup\$ I'm not sure if what you've posted is the correct code at all... \$\endgroup\$ – Erik the Outgolfer Oct 23 '17 at 11:32
  • 1
    \$\begingroup\$ how does ...‘ get those numbers? \$\endgroup\$ – Pureferret Oct 23 '17 at 12:33
  • 1
    \$\begingroup\$ @Pureferret String compression. \$\endgroup\$ – totallyhuman Oct 23 '17 at 12:44
  • \$\begingroup\$ @totallyhuman so how does it 'encode'/compress thoses strings into ...‘? \$\endgroup\$ – Pureferret Oct 23 '17 at 13:52
  • \$\begingroup\$ @dzaima I don't think that actually helps me understand, unfortunately. Entering the first part that encodes the CG into that tool doesn't give ...‘ anywhere in that tool. \$\endgroup\$ – Pureferret Oct 23 '17 at 13:59
4
\$\begingroup\$

Mathematica, 107 bytes

Uncompress@"1:eJxTTMoP8ixgYmAwH8TAkLrAAgqQWYbYGFDVGCxkBh5lCDNwWIqqDCyGrAGDhWEpFmXY3IaiDItPqQqMiQMA+yaAoA=="


Try it online!

\$\endgroup\$
  • \$\begingroup\$ Correct me if I'm wrong, but is that a REPL-only solution? That doesn't seem to be a function (which I'm guessing you could fix with a single & on the end). \$\endgroup\$ – numbermaniac Oct 26 '17 at 8:20
  • \$\begingroup\$ this is not supposed to be a function. this code just outputs the PPCG prime, just like the OP asked \$\endgroup\$ – J42161217 Oct 26 '17 at 9:42
4
\$\begingroup\$

CJam, ASCII, 61

Hs78f*~_@"'hfv;HH`>O4RU(_o^.U)9q&-1iadr`4tk"90b2b88fe|1$'339*

Try it online

Append ]s39/N* for nice wrapping.

Explanation:

Hs         generate "17" (H=17)
78f*       repeat each character 78 times, getting an array of 2 strings
~_         dump the 2 strings on the stack, and duplicate the '7's
@          move the '1's to the top of the stack (first 6 lines done so far)
"…"90b     convert that string from base 90 (treating characters as numbers)
2b         convert the resulting number to base 2,
            obtaining a bit map for the "PPCG" part, with 1 for "1" and 0 for "88"
88fe|      replace (boolean OR) all the zeros with 88
1$         copy the string of 78 '1's
'339*      repeat '3' 39 times
\$\endgroup\$
4
\$\begingroup\$

C, 519 427 414 396 377 bytes

Thanks to Tas, Felix Palmen and Lynn.

#define p(n,l)for(i=40*l;i;)putchar(--i%40?n+48:10);
f(i){p(7,4)p(1,2)puts("188888888118888888811188888811188888811\n188111118818811111881881111881881111881\n188111118818811111881881111111881111111\n188888888118888888811881111111881118888\n188111111118811111111881111111881111881\n188111111118811111111881111881881111881\n188111111118811111111188888811188888811");p(1,2)p(3,1)}

For your interest, here is a longer, easier-to-read version:

#define p(n,l) for(i=40*l;i;) putchar(--i%40?n+48:10);
f(i) {
    p(7,4)
    p(1,2)
    puts("188888888118888888811188888811188888811\n\
       188111118818811111881881111881881111881\n\
       188111118818811111881881111111881111111\n\
       188888888118888888811881111111881118888\n\
       188111111118811111111881111111881111881\n\
       188111111118811111111881111881881111881\n\
       188111111118811111111188888811188888811");
    p(1,2)
    p(3,1)
}
\$\endgroup\$
  • 1
    \$\begingroup\$ You can get much lower (~450ish) by simply printing the 1s and 8s as they are, and having a define for the 7, 3 and 1 \$\endgroup\$ – Tas Oct 24 '17 at 5:34
  • \$\begingroup\$ @Keyu Gan: I am compiling with a current version of GCC (7.2.0-debian11), which allows this for a couple of years. I'm not quite sure if the syntax is maybe in one of the newer C standards. \$\endgroup\$ – xanoetux Oct 24 '17 at 6:25
  • 2
    \$\begingroup\$ @Keyu Gan: It is allowed in C99 and C11. \$\endgroup\$ – xanoetux Oct 24 '17 at 6:30
  • 1
    \$\begingroup\$ 414 bytes \$\endgroup\$ – Felix Palmen Oct 24 '17 at 7:25
  • \$\begingroup\$ This version is very tricky. At least I understand it; thanks. \$\endgroup\$ – xanoetux Oct 24 '17 at 10:40
4
\$\begingroup\$

Java (OpenJDK 8), 165 bytes

n->{for(int i=0;++i<566;)System.out.print(i<157?7:i>526?3:i<236|i>446||new java.math.BigInteger("vnku5g6l0zenpa1kydel5rxw162k4fk4xapa154o",36).testBit(446-i)?1:88);}

Try it online!

Credits

  • -10 bytes thanks to aditsu!
\$\endgroup\$
  • \$\begingroup\$ 165: n->{for(int i=0;++i<566;)System.out.print(i<157?7:i>526?3:i<236|i>446||new java.math.BigInteger("vnku5g6l0zenpa1kydel5rxw162k4fk4xapa154o",36).testBit(446-i)?1:88);} \$\endgroup\$ – aditsu Oct 25 '17 at 17:20
  • \$\begingroup\$ Nice catch, the double 88, thanks! \$\endgroup\$ – Olivier Grégoire Oct 25 '17 at 17:56
2
\$\begingroup\$

Retina, 129 bytes


h155b78i7b1i7b2i5b2i5b2!4!!4!""1!4!!4!!6#i7b1i7b1!6!2i3b##!6"1##""1#!8i5b2i5b79d38
#
!7
"
!3!
!
i1b
\d+
$*
+`(\D)1
$1$1
1

T`l`d

Try it online!

\$\endgroup\$
2
\$\begingroup\$

Batch, 364 335 333 bytes

@set a=888888&set b=1111111111111&set e=1881111&set d=1%e%&set f=333333333&for /L %%x in (1,1,156) do @cd|set/p=7
@echo %b%%b%%b%%b%%b%%b%1%a%8811%a%88111%a%111%a%1%d%188%e%188%e%88%e%88%d%188%e%188%e%1%d%1111%a%8811%a%88%d%111881118888%e%11%d%11%d%1%d%88%d%11%d%11%d%88%e%88%d%11%d%11111%a%111%a%%b%%b%%b%%b%%b%%b%11%f%%f%%f%%f%333
\$\endgroup\$
  • 1
    \$\begingroup\$ Save two bytes by changing echo| to cd| \$\endgroup\$ – stevefestl Oct 23 '17 at 13:05
  • \$\begingroup\$ Thanks, I knew there was something shorter, but couldn't remember \$\endgroup\$ – schnaader Oct 23 '17 at 14:06
  • \$\begingroup\$ Also, (1,1,156) do can be shortened to (1,1,156)do \$\endgroup\$ – stevefestl Oct 23 '17 at 23:07
2
\$\begingroup\$

Javascript (ES6), 187 181 bytes

-6 bytes thanks to @JustinMariner

r=s=>s[0].repeat(39),a=r`7`,b=r`1`,i="8888881",c=188+i,d=11+i,j="188111",e=j+1188,f=j+188,g=j+111,h=g+1,k=r`3`
z=>"aaaabbccdd1eeff1eeghccgj8888hhgf1hhff1hhdd1bbk".replace(/./g,eval)

Super simple approach; it could probably be golfed some more.

Explanation

r=s=>s[0].repeat(39),                               // helper function to repeat character
a=r`7`,b=r`1`,i="8888881",c=188+i,d=11+i,j="188111",// Set the variables (a-k) to different
e=j+1188,f=j+188,g=j+111,h=g+1,k=r`3`               // parts of the prime       

_=>"aaaabbccdd1eeff1eeghccgj8888hhgf1hhff1hhdd1bbk" // Replace all letters in the string
    .replace(/./g,eval)                             // with the value of the variable

Example code snippet (with some helper code to add line breaks in the output)

r=s=>s[0].repeat(39),a=r`7`,b=r`1`,i="8888881",c=188+i,d=11+i,j="188111",e=j+1188,f=j+188,g=j+111,h=g+1,k=r`3`
z=_=>"aaaabbccdd1eeff1eeghccgj8888hhgf1hhff1hhdd1bbk".replace(/./g,eval)
o.innerText=z().replace(/.{39}/g,"$&\n")
<pre id=o>

\$\endgroup\$
  • \$\begingroup\$ You can save some bytes if you define a helper function r as r=s=>s[0].repeat(39) and then replace a, b, and k with r`7` etc. Try it online!. \$\endgroup\$ – Justin Mariner Oct 23 '17 at 21:26
2
\$\begingroup\$

C (gcc), 269 267 bytes

function, uses simple RLE.

x[]={39,79,80,156};k;f(i){for(char*c="d7b1882188316831683128512811285128112841281128412821285128112851281128712881882188212871283148112881288128712841282128812881284128112841282128812891683168c1a3";i=*c++;++c)for(i=i<97?i-48:x[i-97];i--;++k%39||puts(""))putchar(*c);}

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Suggest L"'OP\x9c" instead of x \$\endgroup\$ – ceilingcat Sep 6 '18 at 21:04
2
\$\begingroup\$

C (gcc), 224 bytes

f(i,j,c){for(i=0;c="wwdfFdfFDfFDfFDFDDFFDDFFDddDDFdDDddDDddDDDdDDDDffDffDFDDDFDfdDDDDFDDDdDDDdDDFdDDDDFDDDdDDFFDdDFDDDdDDDDdfDdfD"[i/2]>>i++%2*4&15;c-6?putchar(c-4?c+48:49):printf("88"))for(j=0;j++<c%2*38;)putchar(c+48);}

Try it online!

Contains some unprintables, the string literal is "ww\x11dfFdfFDfFDfFDFDDFFDDFFDddDDFdDDddDDddDDDdDDDDffDffDFDDDFDfdDDDDFDDDdDDDdDDFdDDDDFDDDdDDFFDdDFDDDdDDDDdfDdfD\x11\x03".

\$\endgroup\$
1
\$\begingroup\$

Jelly, 86 bytes

Lẋ@1,8żḣLẋ/€F
7ẋ156;1ẋ78¤©;“½Ẹ^o“2FẒ⁶ġbȥ“¡E⁷£cṿ“t¡ɗḋ“£F¢Xȥ“¡McṾbȥ“¬3Ṭo’DÇ€F¤;®;3rẋ39¤Ḍ

Try it online!

-12 bytes thanks to user202729

\$\endgroup\$
  • \$\begingroup\$ 88 bytes: TIO ( can separates a list of strings inside a string literal) \$\endgroup\$ – user202729 Oct 23 '17 at 6:37
  • \$\begingroup\$ What time is it in your country? Why are you awake right now? \$\endgroup\$ – user202729 Oct 23 '17 at 6:37
  • \$\begingroup\$ @user202729 Oh right, thanks. And I'm in UTC-4 I did a stupid and had to stay up rly late so I felt like doing a challenge before going to sleep since this got reopened. I can elaborate in chat if you'd like :P \$\endgroup\$ – HyperNeutrino Oct 23 '17 at 6:41
1
\$\begingroup\$

Python 2, 309 158 155 136 135 bytes

x='1'*78
s='7'*156+x
a=1
for c in str(int('109PDKEZ3U32K97KJQVELW8GKXCD42EGEYK715B6HPMPL0H8RU',36)):s+=`a`*int(c);a^=9
print s+x+'3'*39

Try it online!

Python 2, 137 bytes

s='7'*156
a=1
for c in'90'*8+str(int('PL6PU5TXIC24LCKIQY50C2LPAIC9TVZEVQGTMM63IHGBBUV1XSA6',36))+'09'*8:s+=`a`*int(c);a^=9
print s+'3'*39

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Jelly, 85 bytes

”7ẋ“ɓ’80“¡Ȯ⁶LÑɓĠ⁶-€Øġ°$¤ṛọḳƓƒṭ⁽@^ḥ⁷Ofạ<e½Ṇż;,RṘ¶ṀḊ+`⁸ⱮḃĿþṛ9.wƑ¡kḟUẎgLLµ’ḃĖŒṙị⁾1839”3ẋ

Try it online!

Based on Dennis's approach to the Trinity Hall challenge, minus the symmetry, plus the leading 7s and trailing 3s.

\$\endgroup\$
  • 3
    \$\begingroup\$ Dennis approached this challenge differently because it is a different one. I think you've been outgolfed! \$\endgroup\$ – user72253 Oct 23 '17 at 13:28
  • \$\begingroup\$ @JoseZaman He made Jelly BTW. \$\endgroup\$ – Erik the Outgolfer Oct 23 '17 at 14:26
1
\$\begingroup\$

PowerShell, 164 bytes

$a='136361616151315131531532513151315215436365213213315454521532545453153254541616';6..2|%{$a=$a-replace$_,(11,88,22,34,3332)[$_-2]};'7'*156+'1'*78+$a+'1'*78+'3'*39

Try it online!

String multiplication, concatenation, and replacements. PowerShell doesn't have base 36 or similar, so large-number compression options are limited. There might be a better way to "compress" the middle part -- I'm still checking on that.

\$\endgroup\$
1
\$\begingroup\$

Wolfram Language (Mathematica), 89 (17+71+1) bytes

First you export the number to a GZIP file. This file, named "o" with no extension will be exactly 71 bytes, which counts towards the total. By default, it will go to your $TemporaryDirectory. Omitting digits for readability.

Export["o",777777...,"GZIP"]

Then

"o"~Import~"GZIP"

will reconstruct the number. The file name is one byte so that's where the +1 comes from.

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Ruby, 109 bytes

The script calls Zlib.inflate to decompress the number. It needs at least Ruby 1.9.3. It contains unprintable bytes, so I can't paste it here.

I paste the output of vis prime-inflate.rb:

require'zlib'
puts Zlib.inflate DATA.read
__END__
x\M-Z37\^_\M-<\M-@\M^P\M-:\M-@\^B
\M^PY\M^F\M-X\^XP\M-U\^X,d\^F\^^e\^H3pX\M^J\M-*\^L,\M^F\M-,\^A\M^C\M^Ea)\^Ve\M-X\M-\\M^F\M-"\^L\M^KO\M-)
\M^L\M^I\^C\^@\^P\M-p~\M-!

If you have unvis(1), run unvis prime-inflate.vis > prime-inflate.rb to restore the 109-byte script. Or you can decode the Base64, below, with ruby -e 'print *STDIN.read.unpack(?m)' < prime-inflate.b64 > prime-inflate.rb.

cmVxdWlyZSd6bGliJwpwdXRzIFpsaWIuaW5mbGF0ZSBEQVRBLnJlYWQKX19F
TkRfXwp42jM3H7zAkLrAAgqQWYbYGFDVGCxkBh5lCDNwWIqqDCyGrAGDhWEp
FmXY3IaiDItPqQqMiQMAEPB+oQ==

I call Zlib.inflate so I don't need to design and golf my own decompression algorithm. I use DATA with __END__ because the compressed string isn't valid UTF-8. Ruby code must be valid ASCII (in Ruby 1.9.x) or UTF-8 (from Ruby 2.0) or have a magic comment #coding:binary to change the encoding, but Ruby doesn't check the encoding after __END__.

\$\endgroup\$
1
\$\begingroup\$

Python 2, 112 bytes

print'7'*156+'1'*78+bin(int('JAOKI5B0O6K9IWDU8P76KDLR0VZMNWQ2WB9D8BOS8',36))[2:].replace('0','88')+'1'*80+'3'*39

Try it online!

\$\endgroup\$
1
\$\begingroup\$

6502 machine code (C64), 142 122 bytes

00 C0 A9 27 85 FB A2 00 86 FC A2 04 CA 10 01 60 BC 70 C0 BD 74 C0 20 D2 FF C6
FB D0 0B 48 A9 27 85 FB A9 0D 20 D2 FF 68 88 D0 EB E0 02 D0 DD 48 A5 FC 4A A8
B9 4A C0 90 04 4A 4A 4A 4A 29 0F F0 08 E6 FC A8 68 49 09 D0 CD 68 D0 C0 28 38
36 36 52 12 52 12 42 12 42 22 52 12 52 12 72 82 28 28 72 32 14 82 82 72 42 22
82 82 42 12 42 22 82 92 36 06 27 50 4F 9C 33 31 31 37

Online demo

Usage: sys49152

  • -20 bytes with better implementation of same method and data tables for large blocks as well.

Explanation

This also uses the lengths of the 1 and 8 sequences in the middle part; as they're all shorter than 16, two of them are encoded per byte.

Commented disassembly listing:

         00 C0        .WORD $C000       ; load address
.C:c000  A9 27        LDA #$27          ; counter for newlines (39)
.C:c002  85 FB        STA $FB
.C:c004  A2 00        LDX #$00          ; index for run-length data
.C:c006  86 FC        STX $FC
.C:c008  A2 04        LDX #$04          ; index for "blocks" (counting down)
.C:c00a   .blockloop:
.C:c00a  CA           DEX
.C:c00b  10 01        BPL .continue     ; block index underflow -> done
.C:c00d  60           RTS
.C:c00e   .continue:
.C:c00e  BC 70 C0     LDY .lseqlens,X   ; load length of next block to Y
.C:c011  BD 74 C0     LDA .chars,X      ; load character of next block to A
.C:c014   .outloop:
.C:c014  20 D2 FF     JSR $FFD2         ; output character
.C:c017  C6 FB        DEC $FB           ; decrement newline counter
.C:c019  D0 0B        BNE .skipnl
.C:c01b  48           PHA               ; newline needed -> save accu
.C:c01c  A9 27        LDA #$27          ; restore newline counter
.C:c01e  85 FB        STA $FB
.C:c020  A9 0D        LDA #$0D          ; load newline character
.C:c022  20 D2 FF     JSR $FFD2         ; output character
.C:c025  68           PLA               ; restore accu
.C:c026   .skipnl:
.C:c026  88           DEY               ; decrement repeat counter
.C:c027  D0 EB        BNE .outloop      ; repeat until 0
.C:c029  E0 02        CPX #$02          ; check for block index of text part
.C:c02b  D0 DD        BNE .blockloop    ; not in text part -> repeat
.C:c02d   .textpart:
.C:c02d  48           PHA               ; save accu
.C:c02e  A5 FC        LDA $FC           ; load index for run-length data
.C:c030  4A           LSR A             ; and shift right
.C:c031  A8           TAY               ; -> to Y register
.C:c032  B9 4A C0     LDA .seqlens,Y    ; load run-length data
.C:c035  90 04        BCC .lownibble    ; carry clear from shift -> low nibble
.C:c037  4A           LSR A             ; shift high nibble into low nibble
.C:c038  4A           LSR A
.C:c039  4A           LSR A
.C:c03a  4A           LSR A
.C:c03b   .lownibble:
.C:c03b  29 0F        AND #$0F          ; mask low nibble
.C:c03d  F0 08        BEQ .textdone     ; run-length zero? then text block done
.C:c03f  E6 FC        INC $FC           ; increment index for run-length data
.C:c041  A8           TAY               ; run-length to y-register
.C:c042  68           PLA               ; restore accu
.C:c043  49 09        EOR #$09          ; toggle between '8' and '1'
.C:c045  D0 CD        BNE .outloop      ; and back to output loop
.C:c047   .textdone:
.C:c047  68           PLA               ; restore accu
.C:c048  D0 C0        BNE .blockloop    ; back to loop for next block
.C:c04a   .seqlens:
.C:c04a  28 38 36 36  .BYTE $28,$38,$36,$36
.C:c04e  52 12 52 12  .BYTE $52,$12,$52,$12
.C:c052  42 12 42 22  .BYTE $42,$12,$42,$22
.C:c056  52 12 52 12  .BYTE $52,$12,$52,$12
.C:c05a  72 82 28 28  .BYTE $52,$82,$28,$28
.C:c05e  72 32 14 82  .BYTE $72,$32,$14,$82
.C:c062  82 72 42 22  .BYTE $82,$72,$42,$22
.C:c066  82 82 42 12  .BYTE $82,$82,$42,$12
.C:c06a  42 22 82 92  .BYTE $42,$22,$82,$92
.C:c06e  36 06        .BYTE $36,$06
.C:c070   .lseqlens:
.C:c070  27 50 4F 9C  .BYTE $27,$50,$4F,$9C
.C:c074   .chars:
.C:c074  33 31 31 37  .BYTE "3117"
\$\endgroup\$
1
\$\begingroup\$

C (gcc), 188 187 185 bytes

-1 thanks to JonathanFrech.

-2 thanks to ceilingcat.

#define F(c,n)for(c=0;c<n;c++)
i,j,k;r(d,n){F(k,n)printf("%d",d);}f(){r(7,156);r(1,79);F(i,45)F(j,6)r("pdpi8pIa7]R>=4gQ>Q2iPoX2=O4a1=QRJ17QR>=4a1i8p"[i]-49>>j&1?8:1,1);r(1,80);r(3,39);}

Try it online!

\$\endgroup\$
  • 2
    \$\begingroup\$ Welcome to PPCG, nice first answer! \$\endgroup\$ – ovs Nov 7 '17 at 19:15
  • \$\begingroup\$ I think you can shift your string to get to a string which does not need escaping a backslash, resulting in 187 bytes. \$\endgroup\$ – Jonathan Frech Nov 7 '17 at 21:03
  • \$\begingroup\$ @JonathanFrech Ah, nice one! \$\endgroup\$ – gastropner Nov 8 '17 at 11:56
  • \$\begingroup\$ @ceilingcat Good catch! \$\endgroup\$ – gastropner Aug 21 '18 at 5:52
0
\$\begingroup\$

Python 2, 244 128 120 bytes

-8 bytes thanks to @JonathanFrech

s='1'*78
print'7'*156+s+bin(int("8zlghh9gqo74zwzntkcjmoou35vvlbg1cmasrm6ny1iafcvw568sj",36))[2:].replace(*'08')+s+'3'*39

Try it online!

\$\endgroup\$
0
\$\begingroup\$

Befunge-93, 500 bytes

v F         >20g1-20p
>"3"20g10g`#^_>52*"F"20p30g10g`#v_"^!1"21p30p84*2+1p
^                       p03-1g03<
^>"81118888888811888888881>!"30p84*2+1p52*
^^"8888811188888811"*25"188111118"<>">#7"21p30p57*5p
>*"188111188188111188188111118818"^ $>:#,_@
^25"18811111881881111188188111111"<
>"8888811888888881"25*"1111111881"^
^"88811881111111881118888"*25"188"<
>"1188111111188111111118811111111"^
^"11881"*52"188111111118811111111"<
>"11111881"52*"188111188188111188"^
^"1118811111111188888811188888811"<

Try it online!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy