Combination Lock by Natte

dist=->a,b{[(b-a)%10,(a-b)%10].min}

$<.map{|l|
 d=l.to_i
 a,b,c=d/100,d/10%10,d%10
 #p d
 p [dist[a,b]+dist[a,c], dist[b,a]+dist[b,c], dist[c,a]+dist[c,b]].min
}

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

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page