Derangements by rolf

def d(s,i):
 if i>6:print s
 for c in"123456":c in s or c==`i`or d(s+c,i+1)
d("",1)

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

download

return to the top page