Re: my cryptogram program

2006-05-16 Thread bruno at modulix
John Salerno wrote: > Bruno Desthuilliers wrote: > >> At least someone reading this may learn about the max_split param of >> str.split() !-) > > > LOL. The first thing I did was scramble to the docs to see what that > second parameter meant! :) > > But I was a little confused about why you inc

Re: my cryptogram program

2006-05-16 Thread John Salerno
Bruno Desthuilliers wrote: > At least someone reading this may learn about the max_split param of > str.split() !-) LOL. The first thing I did was scramble to the docs to see what that second parameter meant! :) But I was a little confused about why you included it. Just to insure that only t

Re: my cryptogram program

2006-05-16 Thread John Salerno
Bruno Desthuilliers wrote: > Too late ! You asked for it, you get it !-) Good, I desperately need it! :) > PUNCT_SPACE_SET = set(string.punctuation + string.whitespace) > def make_set(original): > return ''.join(set(original) - PUNCT_SPACE_SET) Interesting! Always learning new, weird ways to

Re: my cryptogram program

2006-05-16 Thread John Salerno
Paul Rubin wrote: > You're trying to make sure that no character maps to itself in the > cryptogram. I'm not sure if that's one of the "rules". It's a rule for cryptogram puzzles, which is what I'm working on. I'm not trying to make complicated hacker-proof codes or anything. :) > It also loo

Re: my cryptogram program

2006-05-15 Thread Bruno Desthuilliers
Paul Rubin a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > >>def convert_quote(quote): >> return make_code(quote).split('|', 1) > > > I thought about suggesting that, but it's semantically different than > the original since it fails to raise an error if no vertical bar is > pres

Re: my cryptogram program

2006-05-15 Thread Paul Rubin
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > def convert_quote(quote): >return make_code(quote).split('|', 1) I thought about suggesting that, but it's semantically different than the original since it fails to raise an error if no vertical bar is present. I don't know if that's good or

Re: my cryptogram program

2006-05-15 Thread Paul Rubin
John Salerno <[EMAIL PROTECTED]> writes: > def convert_quote(quote): > coded_quote = make_code(quote) > author = coded_quote.split('|')[1] > quote = coded_quote.split('|')[0] > return quote, author I think it's a little bit ugly (plus inefficient) to split the quote twice. You

Re: my cryptogram program

2006-05-15 Thread Bruno Desthuilliers
John Salerno a écrit : > Alrighty, here is what I've come up with. Any suggestions for tweaks or > speed-boosting efficiency? Just kidding. :) Too late ! You asked for it, you get it !-) > Maybe the weakest part is how the code is determined (just shuffling the > letters in the alphabet). Perha