Resistor color code by NikNakk

a=as.numeric
d=b=sub("(.)","\\U\\1",c("silver",colors()[c(142,24,32,552,498,652,254,26,640,260,1)]),pe=T)
d[3]=""
y=sprintf("%1.2e",a(sub("M","e6",sub("k","e3",scan("stdin","")))))
`*`=function(v,w)a(substr(y,v,w))
e=4*4
write(gsub(" +","-",paste(b[3+1*1],b[3+3*3],d[3+e],b[2+6*8-(e>0)])),T)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page