
July 1, 2003
5:14 a.m.
At 10:07 PM 6/30/2003 -0700, Kirby Urner wrote:
p1 [['A', 'W', 'Z', 'R', 'N', 'G'], ['C', 'Q', 'S', 'X', ' ', 'B', 'M'], ['E', 'V', 'L'], ['D', 'K', 'J', 'O', 'Y', 'P', 'H', 'T', 'U', 'F', 'I']]
Using cyclic notation e.g. A goes to W, W to R and so on.
Goofed again. A to W, W to Z, Z to R and so on (G to A). I use the random.shuffle(list) function to jiggle the letters and make the permutation. def simplecode (elems): neworder = elems[:] # make copy random.shuffle(neworder) return dict( zip(elems, neworder) ) The letters are just: letters = list(string.ascii_uppercase + ' ') Better quit now, before this thread becomes a never ending erratum. Kirby