photosinensis: It's the 100x100 version of XKCD #353 (Default)
posted by [personal profile] photosinensis at 10:40pm on 06/07/2010 under
So I ran across this blog entry while browsing Reddit today. Now, the bank got taken by this guy. They wanted a Caesar cypher, and he gave them, well, it's an abomination.

In Python:


def caesar(string, key):
  return "".join([x if ord(x.lower()) not in range(97, 123) else chr((((ord(x.lower()) - 97) + key) % 26) + 97) for x in string])


That's in one line, and it preserves spaces and punctuation. We'll not mention his problems with command line user interfaces, which are quite powerful and awesome.

Reply

From:
Anonymous
OpenID
Identity URL: 
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org


 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

October

SunMonTueWedThuFriSat
  1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29 30
 
31