R, 195 자
A=strsplit(scan(,""),"")[[1]];cat(A[order(sapply(A,function(x){png('a',a='none',fa='monospace');frame();text(0,0,x);dev.off();sum(apply(png::readPNG('a'),c(1,2),function(x)any(x!=1)))}))],sep="")
주석으로 들여 쓰기 :
A=strsplit(scan(,""),"")[[1]] #Take characters as strings and split into single chars
cat(A[order(sapply(A,function(x){ #Apply the following function to each char and order accordingly
png('a',a='none',fa='monospace'); #Open empty png without antialiasing and with monospace font
frame(); #create empty plot
text(0,0,x); #add the char as text to the plot
dev.off(); #close png device
sum(apply(png::readPNG('a'), #read it back as rbga 3d matrix
c(1,2), #check every layer (R, G, B, A)
function(x)any(x!=1))) #if any are not 1, send TRUE
}))], #Sum all TRUEs
sep="") #Prints to output
예:
> A=strsplit(scan(,""),"")[[1]];cat(A[order(sapply(A,function(x){png('a',a='none',fa='monospace');frame();text(0,0,x);dev.off();sum(apply(png::readPNG('a'),c(1,2),function(x)any(x!=1)))}))],sep="")
1: @+.0
2:
Read 1 item
.+0@
> A=strsplit(scan(,""),"")[[1]];cat(A[order(sapply(A,function(x){png('a',a='none',fa='monospace');frame();text(0,0,x);dev.off();sum(apply(png::readPNG('a'),c(1,2),function(x)any(x!=1)))}))],sep="")
1: 1234567890
2:
Read 1 item
1723450689
R 플롯에서 글꼴을 플랫폼에 따라 다름으로써 PC에서 작동한다고 보장 할 수는 없지만 Mac (OS X 10.7.5, R 2.14.2)에서는 작동합니다.