Befunge-98, 3 distinct characters
"++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"++++++++++++++++++++++++++++++++++++,",,,,,,,,,,,,,,"+++++++++++++,"+++,,,,,,,,,,,"+++++++++++++,",,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++,"+++++++,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++,"+++,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++,"+++++++,,,,,,,,,,,,,"+++++++++++++++++++,"+++++,,,,,,,,,"+++++++++++++,"+++++,,,,,,,,,,,,,,,"+++++++++++++++++++,",,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++,"++++++,,,,,,,,"+++++++++++++,"++++++,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++,"+,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++,"+,,,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++,"++,,,,,,,,,,,,,,,,,,"+++++++++++++++++++,",,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++,"++,,,,,,,,,,,,"+++++++++++++,"+,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++,",,,,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++,",,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++,"++++++,,,,,,,,,,,,,,"+++++++++++++++++++,"+++,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++,"+++,,,,,,,,,,,,,,,,,"+++++++++++++++++++,",,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++,"+++++,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++,",,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++,"+,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++,"++,,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++,"+++,,,,,,,,,,,"+++++++++++++,"++++++,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++,",,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++,"++++,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++,",,,,,,,,,,,,,,"+++++++++++++,"+++,,,,,,,,,,,"+++++++++++++,",,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++,"++++,,,,,,,,,,,,,,,,"+++++++++++++++++++,"+++++++,,,,,,,"+++++++++++++,"++++++,,,,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++++++++,"+++++++,,,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++++++++++,",,,,,,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++++++,"++++,,,,,,,,,,"+++++++++++++,"+,,,,,,,,,,,,,,,,,,,"+++++++++++++++++++,"+,,,,,,,,,,,,,"+++++++++++++,"+++,,,,,,,,,"+++++++++++,
Using this Befunge-98 interpreter. At first, I joined the 4-character competition with an @
at the end to terminate . This program repeatedly outputs The quick brown fox jumps over the lazy dog\r
, where the terminating \r
deletes the previous sentence. Therefore, the sentence is written once.
Befunge-98, 4 distinct characters (1047 characters in total)
"@@@,,,,,,,,,,,,,,,"+++++++++++++++++,",,,,,,,,,,,,,,"+++++++++++++,"+++,,,,,,,,,,,"+++++++++++++,"@@@,,,,,,,,"++++++++++,"@+++,,,,"+++++++,"@@@+++,,,,,,,"++++++++++++,"@@+++,,,,,,,,,,,,,,"++++++++++++++++++,"@@+,,,,,,,,,,"++++++++++++,"@+"+,"@@@,,,,,,,,"++++++++++,"@@++,,,,,,,,,"++++++++++++,"@++,,,,,"+++++++,"@@@+,,,"++++++,"@@@+,,,,,,,,,"++++++++++++,"@@@++,,"++++++,"@@@,,,,,,,,"++++++++++,"++,,,,,,,,,,,,"+++++++++++++,"@@@+,,,"++++++,"@@@,,,,,,,,,,"++++++++++++,"@@@,,,,,,,,"++++++++++,"@@++,,,,,,,,,,,,,,,"++++++++++++++++++,"@@@+++,,,,,,,"++++++++++++,"@@@+++,"++++++,"@@@,,,,"++++++,"@+,,,,,,"+++++++,"@@@,,,,,,,,"++++++++++,"@@@+,,,"++++++,"@@@++,,,,,,,,"++++++++++++,"+++,,,,,,,,,,,"+++++++++++++,"@++,,,,,"+++++++,"@@@,,,,,,,,"++++++++++,"@,,,,,,,"+++++++,",,,,,,,,,,,,,,"+++++++++++++,"+++,,,,,,,,,,,"+++++++++++++,"@@@,,,,,,,,"++++++++++,"@,"+,"@@+++,,,,,,,,"++++++++++++,"@++,,,,,,,,,,,"+++++++++++++,"@+++,,,,,,,,,,"+++++++++++++,"@@@,,,,,,,,"++++++++++,"@@,,,,,,,,,,,"++++++++++++,"@@@+,,,"++++++,"+,,,,,,,,,,,,,"+++++++++++++,@
The less cheaty version. This one terminates normally.
OP you could make this more fun by requiring that users write a program that takes a string as input and outputs another program that prints the input string with as few chars as possible. – Soham Chowdhury – 2013-04-17T10:58:46.970
Is the output case sensitive? – zzzzBov – 2013-04-17T13:57:53.627
@zzzzBov: yes, the leading T needs to be uppercase and everything else lowercase. – Fraxtil – 2013-04-17T22:53:40.693
Can we make
least-characters
an official criteria and tag, likecode-golf
– EAKAE – 2013-04-18T01:14:06.8332@EAKAE, how many different questions like this would actually be interesting? Many of the answers here are general solutions that can execute arbitrary code. – None – 2013-04-18T11:18:23.960
@SohamChowdhury This Erlang function takes string and returns
dc
program to output this string using 4 distinct chars:F=fun(S)->L=length(S)*8,<<I:L>>=list_to_binary(S),[_|T]=integer_to_list(I,2),io:put_chars([$1,lists:reverse([case X of$1->"dd+";$0->"d+"end||X<-T],[$+||$1<-T]),$P,10])end.
– Hynek -Pichi- Vychodil – 2013-04-20T21:58:04.403I think I can follow the logic. Nice. – Soham Chowdhury – 2013-04-21T01:23:00.837
Related: Keep the unique characters down
– sergiol – 2018-04-30T00:26:03.160