Resistor color code by mitchs (hallvabo)

a='Black Brown Red Orange Yellow Green Blue Violet Grey White Silver Gold'.split()
while~0:
 p=s=0;t=''
 for(c)in raw_input():x='0kM.'.find(c);t+=x<0and a[int(c)]+'-'or'';p+=(1+s,3,6,s)[x];s-=x>2
 b=len(t)<8;print t+b*'Black-'+a[p-b]

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

download

return to the top page