Skip to main content
added 6 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104

C (gcc), 260 187 167 156 152 147 143143 138 bytes

i,*m,o;f*m;f(e){for(m=L"...",i=0;e>0;printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,o))o=(e-=*m)<0?*m+e:*m++;*m++));}

Try it online!Try it online! Golfed from the reference implementation.

StackExchange removes unprintables, so the value of m is replaced with "...".

Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6} with the literal byte values of the integers.

00000000: 692c 2a6d 2c6f 3b66 2865 297b 666f 7228 6d3d  i,*m,o;f*m;f(e){for(m=
00000010: 6d3d 4c22 0202 0602 065c 6e02 065c 6e02 060e  m=L"L".....\n..\n...
00000020: 060e 5c6e 0206 0e5c 6e02 0622 2c69 3d30 3b65 .. \n...\n..",i=0i=0;e
00000030: 3b65 3e30 3b70 7269 6e74 6628 2225 2e32 7325 ;e>0;printf >0;printf("%.22s%
00000040: 7325 6420 222c 2231 7332 7332 7033 7333 7033 s%d d ","1s2s2p3s3"1s2s2p3s3p3
00000050: 7033 6434 7334 7034 6435 7335 7034 6635 6436 p3d4s4p4d5s5p4f5 d4s4p4d5s5p4f5d6
00000060: 6436 7336 7035 6636 6437 7337 7022 2b69 2b2b  d6s6p5f6d7s7p"+is6p5f6d7s7p"+i++
00000070: 2b2b 2a32 2c6f2c28 2929652d 6f3d3d2a 28656d29 2d3d3c30 2a6d3f2a 6d2b  ++*2*2,o))o=(e-=*m)<0?*m+
00000080: 293c 303f653a 2a6d 2b652b2b 3a2a2929 6d2b3b7d 2b3b 7d    )<0?*m+e           e:*m++;*m++));}

Alternatively, you could just copy the code from the TIO link.

C (gcc), 260 187 167 156 152 147 143 bytes

i,*m,o;f(e){for(m=L"...",i=0;e>0;printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,o))o=(e-=*m)<0?*m+e:*m++;}

Try it online! Golfed from the reference implementation.

StackExchange removes unprintables, so the value of m is replaced with "...".

Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6} with the literal byte values of the integers.

00000000: 692c 2a6d 2c6f 3b66 2865 297b 666f 7228  i,*m,o;f(e){for(
00000010: 6d3d 4c22 0202 0602 065c 6e02 065c 6e02  m=L".....\n..\n.
00000020: 060e 5c6e 0206 0e5c 6e02 0622 2c69 3d30  ..\n...\n..",i=0
00000030: 3b65 3e30 3b70 7269 6e74 6628 2225 2e32  ;e>0;printf("%.2
00000040: 7325 6420 222c 2231 7332 7332 7033 7333  s%d ","1s2s2p3s3
00000050: 7033 6434 7334 7034 6435 7335 7034 6635  p3d4s4p4d5s5p4f5
00000060: 6436 7336 7035 6636 6437 7337 7022 2b69  d6s6p5f6d7s7p"+i
00000070: 2b2b 2a32 2c6f 2929 6f3d 2865 2d3d 2a6d  ++*2,o))o=(e-=*m
00000080: 293c 303f 2a6d 2b65 3a2a 6d2b 2b3b 7d    )<0?*m+e:*m++;}

Alternatively, you could just copy the code from the TIO link.

C (gcc), 260 187 167 156 152 147 143 138 bytes

i,*m;f(e){for(m=L"...",i=0;e>0;printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,(e-=*m)<0?*m+e:*m++));}

Try it online! Golfed from the reference implementation.

StackExchange removes unprintables, so the value of m is replaced with "...".

Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6} with the literal byte values of the integers.

00000000: 692c 2a6d 3b66 2865 297b 666f 7228 6d3d  i,*m;f(e){for(m=
00000010: 4c22 0202 0602 065c 6e02 065c 6e02 060e  L".....\n..\n...
00000020: 5c6e 0206 0e5c 6e02 0622 2c69 3d30 3b65  \n...\n..",i=0;e
00000030: 3e30 3b70 7269 6e74 6628 2225 2e32 7325  >0;printf("%.2s%
00000040: 6420 222c 2231 7332 7332 7033 7333 7033  d ","1s2s2p3s3p3
00000050: 6434 7334 7034 6435 7335 7034 6635 6436  d4s4p4d5s5p4f5d6
00000060: 7336 7035 6636 6437 7337 7022 2b69 2b2b  s6p5f6d7s7p"+i++
00000070: 2a32 2c28 652d 3d2a 6d29 3c30 3f2a 6d2b  *2,(e-=*m)<0?*m+
00000080: 653a 2a6d 2b2b 2929 3b7d                 e:*m++));}

Alternatively, you could just copy the code from the TIO link.

deleted 63 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104

C (gcc), 260 187 167 156 152 147147 143 bytes

i,*m,o;f(e){for(m=L"...",i=0;e>0;o?printfi=0;e>0;printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,o):0)o=(e-=*m)<0?*m+e:*m++;}

Try it online!Try it online! Golfed from the reference implementation.

StackExchange mangles theremoves unprintables, so the value of m is replaced with "...".

Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6} with the literal byte values of the integers.

00000000: 692c 2a6d 2c6f 3b66 2865 297b 666f 7228  i,*m,o;f(e){for(
00000010: 6d3d 4c22 0202 0602 065c 6e02 065c 6e02  m=L".....\n..\n.
00000020: 060e 5c6e 0206 0e5c 6e02 0622 2c69 3d30  ..\n...\n..",i=0
00000030: 3b65 3e30 3b6f 3f703b70 7269 6e74 6628 2225 2e32 ;e>0;o?printf ;e>0;printf("%.2
00000040: 2e32 7325 6420 222c 2231 7332 7332 7033 7333 .2s%d s%d ","1s2s2p3"1s2s2p3s3
00000050: 7333 7033 6434 7334 7034 6435 7335 7034 6635  s3p3d4s4p4d5s5p4p3d4s4p4d5s5p4f5
00000060: 6635 6436 7336 7035 6636 6437 7337 7022 2b69  f5d6s6p5f6d7s7p"d6s6p5f6d7s7p"+i
00000070: 2b69 2b2b 2a32 2c6f 293a 30292929 6f3d 2865 2d3d +i++*22a6d  ++*2,o):0)o=(e-=*m
00000080: 2d3d 2a6d 293c 303f 2a6d 2b65 3a2a 6d2b  -=*m)<0?*m+e:*m+
00000090: 2b3b 7d                                  +;)<0?*m+e:*m++;}

Alternatively, you could just copy the code from the TIO link.

C (gcc), 260 187 167 156 152 147 bytes

i,*m,o;f(e){for(m=L"...",i=0;e>0;o?printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,o):0)o=(e-=*m)<0?*m+e:*m++;}

Try it online! Golfed from the reference implementation.

StackExchange mangles the unprintables, so the value of m is replaced with "...".

Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6} with the literal byte values of the integers.

00000000: 692c 2a6d 2c6f 3b66 2865 297b 666f 7228  i,*m,o;f(e){for(
00000010: 6d3d 4c22 0202 0602 065c 6e02 065c 6e02  m=L".....\n..\n.
00000020: 060e 5c6e 0206 0e5c 6e02 0622 2c69 3d30  ..\n...\n..",i=0
00000030: 3b65 3e30 3b6f 3f70 7269 6e74 6628 2225  ;e>0;o?printf("%
00000040: 2e32 7325 6420 222c 2231 7332 7332 7033  .2s%d ","1s2s2p3
00000050: 7333 7033 6434 7334 7034 6435 7335 7034  s3p3d4s4p4d5s5p4
00000060: 6635 6436 7336 7035 6636 6437 7337 7022  f5d6s6p5f6d7s7p"
00000070: 2b69 2b2b 2a32 2c6f 293a 3029 6f3d 2865  +i++*2,o):0)o=(e
00000080: 2d3d 2a6d 293c 303f 2a6d 2b65 3a2a 6d2b  -=*m)<0?*m+e:*m+
00000090: 2b3b 7d                                  +;}

Alternatively, you could just copy the code from the TIO link.

C (gcc), 260 187 167 156 152 147 143 bytes

i,*m,o;f(e){for(m=L"...",i=0;e>0;printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,o))o=(e-=*m)<0?*m+e:*m++;}

Try it online! Golfed from the reference implementation.

StackExchange removes unprintables, so the value of m is replaced with "...".

Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6} with the literal byte values of the integers.

00000000: 692c 2a6d 2c6f 3b66 2865 297b 666f 7228  i,*m,o;f(e){for(
00000010: 6d3d 4c22 0202 0602 065c 6e02 065c 6e02  m=L".....\n..\n.
00000020: 060e 5c6e 0206 0e5c 6e02 0622 2c69 3d30  ..\n...\n..",i=0
00000030: 3b65 3e30 3b70 7269 6e74 6628 2225 2e32  ;e>0;printf("%.2
00000040: 7325 6420 222c 2231 7332 7332 7033 7333  s%d ","1s2s2p3s3
00000050: 7033 6434 7334 7034 6435 7335 7034 6635  p3d4s4p4d5s5p4f5
00000060: 6436 7336 7035 6636 6437 7337 7022 2b69  d6s6p5f6d7s7p"+i
00000070: 2b2b 2a32 2c6f 2929 6f3d 2865 2d3d 2a6d  ++*2,o))o=(e-=*m
00000080: 293c 303f 2a6d 2b65 3a2a 6d2b 2b3b 7d    )<0?*m+e:*m++;}

Alternatively, you could just copy the code from the TIO link.

edited body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104

C (gcc), 260 187 167 156 152152 147 bytes

i,*m,o;f(e){for(m=L"...",i=0;i<19&e>0;oi=0;e>0;o?printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,o):0)o=(e-=*m)<0?*m+e:*m++;}

Try it online!Try it online! Golfed from the reference implementation.

StackExchange mangles the unprintables, so the value of m is replaced with "...".

Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6} with the literal byte values of the integers.

00000000: 692c 2a6d 2c6f 3b66 2865 297b 666f 7228  i,*m,o;f(e){for(
00000010: 6d3d 4c22 0202 0602 065c 6e02 065c 6e02  m=L".....\n..\n.
00000020: 060e 5c6e 0206 0e5c 6e02 0622 2c69 3d30  ..\n...\n..",i=0
00000030: 3b693b65 3c313e30 39263b6f 653e3f70 303b7269 296f6e74 3d286628 652d2225  ;i<19&e>0;)o=;e>0;o?printf(e-"%
00000040: 3d2a2e32 6d297325 3c306420 3f2a222c 6d2b2231 653a7332 2a6d7332 2b2b7033  =*m)<0?*m+e:*m++.2s%d ","1s2s2p3
00000050: 2c6f7333 3f707033 72696434 6e747334 66287034 22256435 2e327335 73257034  ,o?printf("%.2s%s3p3d4s4p4d5s5p4
00000060: 6420 222c6635 22316436 73327336 73327035 70336636 73336437 70337337 7022 d ","1s2s2p3s3p3f5d6s6p5f6d7s7p"
00000070: 64342b69 73342b2b 70342a32 64352c6f 7335293a 70343029 66356f3d 64362865  d4s4p4d5s5p4f5d6+i++*2,o):0)o=(e
00000080: 73362d3d 70352a6d 6636293c 6437303f 73372a6d 70222b65 2b693a2a 2b2b6d2b  s6p5f6d7s7p"+i++-=*m)<0?*m+e:*m+
00000090: 2a322b3b 2c6f7d 293a 303b 7d                   *2,o):0;            +;}

Alternatively, you could just copy the code from the TIO link.

C (gcc), 260 187 167 156 152 bytes

i,*m,o;f(e){for(m=L"...",i=0;i<19&e>0;o?printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,o):0)o=(e-=*m)<0?*m+e:*m++;}

Try it online! Golfed from the reference implementation.

StackExchange mangles the unprintables, so the value of m is replaced with "...".

Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6} with the literal byte values of the integers.

00000000: 692c 2a6d 2c6f 3b66 2865 297b 666f 7228  i,*m,o;f(e){for(
00000010: 6d3d 4c22 0202 0602 065c 6e02 065c 6e02  m=L".....\n..\n.
00000020: 060e 5c6e 0206 0e5c 6e02 0622 2c69 3d30  ..\n...\n..",i=0
00000030: 3b69 3c31 3926 653e 303b 296f 3d28 652d  ;i<19&e>0;)o=(e-
00000040: 3d2a 6d29 3c30 3f2a 6d2b 653a 2a6d 2b2b  =*m)<0?*m+e:*m++
00000050: 2c6f 3f70 7269 6e74 6628 2225 2e32 7325  ,o?printf("%.2s%
00000060: 6420 222c 2231 7332 7332 7033 7333 7033  d ","1s2s2p3s3p3
00000070: 6434 7334 7034 6435 7335 7034 6635 6436  d4s4p4d5s5p4f5d6
00000080: 7336 7035 6636 6437 7337 7022 2b69 2b2b  s6p5f6d7s7p"+i++
00000090: 2a32 2c6f 293a 303b 7d                   *2,o):0;}

Alternatively, you could just copy the code from the TIO link.

C (gcc), 260 187 167 156 152 147 bytes

i,*m,o;f(e){for(m=L"...",i=0;e>0;o?printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,o):0)o=(e-=*m)<0?*m+e:*m++;}

Try it online! Golfed from the reference implementation.

StackExchange mangles the unprintables, so the value of m is replaced with "...".

Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6} with the literal byte values of the integers.

00000000: 692c 2a6d 2c6f 3b66 2865 297b 666f 7228  i,*m,o;f(e){for(
00000010: 6d3d 4c22 0202 0602 065c 6e02 065c 6e02  m=L".....\n..\n.
00000020: 060e 5c6e 0206 0e5c 6e02 0622 2c69 3d30  ..\n...\n..",i=0
00000030: 3b65 3e30 3b6f 3f70 7269 6e74 6628 2225  ;e>0;o?printf("%
00000040: 2e32 7325 6420 222c 2231 7332 7332 7033  .2s%d ","1s2s2p3
00000050: 7333 7033 6434 7334 7034 6435 7335 7034  s3p3d4s4p4d5s5p4
00000060: 6635 6436 7336 7035 6636 6437 7337 7022  f5d6s6p5f6d7s7p"
00000070: 2b69 2b2b 2a32 2c6f 293a 3029 6f3d 2865  +i++*2,o):0)o=(e
00000080: 2d3d 2a6d 293c 303f 2a6d 2b65 3a2a 6d2b  -=*m)<0?*m+e:*m+
00000090: 2b3b 7d                                  +;}

Alternatively, you could just copy the code from the TIO link.

deleted 73 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading
added 4 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading
deleted 2 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading
deleted 3 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading
added 991 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading
deleted 70 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading