Skip to main content

Timeline for Print all Country Codes

Current License: CC BY-SA 3.0

11 events
when toggle format what by license comment
Oct 22, 2014 at 8:56 comment added xnor Golfed down to 221 by squishing into a single loop and a few other tricks: for X in range(676):print[chr(65+X/26)+chr(65+X%26)," "][int("8hfxckgq1olihfa47x3rrdkojzkklec7qk1hp4ht6avmzxfg7c4uv14xe0pzvvg93x81ag2bf88v2w0p3p08g8nwtuktbwosj9dytset3qmhdl72v5u62nepapgabdqqu7x",36)&1<<X<1]+"\n"[~X%26:],
Oct 14, 2014 at 4:05 comment added grc You can save some more chars with: for r in R:print" ".join((' %c'*2%(65+r,65+c))[int("...",36)>>c+r*26&1::2]for c in R)
Oct 13, 2014 at 21:40 comment added Greg Hewgill Interesting. I happen to be using Python 2.6.6 on this box.
Oct 13, 2014 at 21:38 comment added Falko Ok, it seems to depend on the interpreter. My Python 2.7.8 does allow 26else. (Python 2.7.6, however, does not.)
Oct 13, 2014 at 21:33 comment added Greg Hewgill @Falko: Thanks, only 3 because 26else is not parseable. I thought I tried removing the parentheses but I must have had something else wrong at that point!
Oct 13, 2014 at 21:31 history edited Greg Hewgill CC BY-SA 3.0
added 2374 characters in body
Oct 13, 2014 at 21:28 comment added Falko Oh, and 4 more writing ...,36)&1<<c+r*26else.... - Would you mind posting your script for generating the base-36 integer?
Oct 13, 2014 at 21:21 history edited Greg Hewgill CC BY-SA 3.0
added 3 characters in body
Oct 13, 2014 at 21:20 comment added Greg Hewgill @Falko: That won't work because I need two iterators. Oh wait, this is python 2, where range returns a list!
Oct 13, 2014 at 21:20 comment added Falko You save 4 bytes using R=range(26).
Oct 13, 2014 at 21:12 history answered Greg Hewgill CC BY-SA 3.0