Skip to main content
shorter version
Source Link
seshoumara
  • 3.8k
  • 1
  • 14
  • 31

dc, 3 distinct characters (1, Z, P1ZP), 4143 3707 bytes

I'm surprised no one tried theA trivial dc solution of usingis to use as many 1s as the ASCII code of a character (except for 'o'), then printingto print the size of the (unary) number with P. No arithmetic necessary!

111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111P11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111P111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111P1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111P1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP 

Try it online!Try it online!

I used the following bash code, not golfed, to generate the above dc script containing 4.143 characters:

echo "The quick brown fox jumps over the lazy dog"|fold -1|while IFS= read -r c;do [ "$c" = "o" ] && echo 111P || yes 1|sed "$(echo -n "$c"|od -An -tuC)"q|paste -sd ''|sed 's:$:ZP:' done|paste -sd '' 

dc, 3 distinct characters (1, Z, P)

I'm surprised no one tried the trivial dc solution of using as many 1s as the ASCII code of a character, then printing the size of the (unary) number with P. No arithmetic necessary!

111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP 

Try it online!

I used the following bash code, not golfed, to generate the above dc script containing 4.143 characters:

echo "The quick brown fox jumps over the lazy dog"|fold -1|while IFS= read -r c;do yes 1|sed "$(echo -n "$c"|od -An -tuC)"q|paste -sd ''|sed 's:$:ZP:' done|paste -sd '' 

dc, 3 distinct characters (1ZP), 4143 3707 bytes

A trivial dc solution is to use as many 1s as the ASCII code of a character (except for 'o'), then to print the size of the (unary) number with P. No arithmetic necessary!

111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111P11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111P111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111P1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111P1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP 

Try it online!

I used the following bash code, not golfed, to generate the above dc script:

echo "The quick brown fox jumps over the lazy dog"|fold -1|while IFS= read -r c;do [ "$c" = "o" ] && echo 111P || yes 1|sed "$(echo -n "$c"|od -An -tuC)"q|paste -sd ''|sed 's:$:ZP:' done|paste -sd '' 
Source Link
seshoumara
  • 3.8k
  • 1
  • 14
  • 31

dc, 3 distinct characters (1, Z, P)

I'm surprised no one tried the trivial dc solution of using as many 1s as the ASCII code of a character, then printing the size of the (unary) number with P. No arithmetic necessary!

111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP11111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111ZP 

Try it online!

I used the following bash code, not golfed, to generate the above dc script containing 4.143 characters:

echo "The quick brown fox jumps over the lazy dog"|fold -1|while IFS= read -r c;do yes 1|sed "$(echo -n "$c"|od -An -tuC)"q|paste -sd ''|sed 's:$:ZP:' done|paste -sd ''