Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Timeline for States and Capitals

Current License: CC BY-SA 3.0

18 events
when toggle format what by license comment
Oct 2, 2019 at 20:18 comment added Koishore Roy And I thought add 50 modulo 100 to a list of states and state capitals was math intensive. :3
Nov 19, 2015 at 20:10 comment added rayryeng @ΚριτικσιΛίθος It's fine. Just wanted to make sure that what I know of Python isn't being contradicted :) FWIW, that JS trick is quite useful.
Nov 19, 2015 at 20:09 comment added user41805 @rayryeng I am terribly sorry for getting confused with JS and Python.
Nov 19, 2015 at 16:30 comment added rayryeng I updated my comment. It doesn't work. Try it yourself online: ideone.com/IIYVUG - You get a TypeError. This is a Python answer, not JavaScript. Only by inserting quotations in between the 0 will it work.
Nov 19, 2015 at 16:29 comment added user41805 @rayryeng It says "Tips for JavaScript" for me. If you still can't access it, then search for "Tips for golfing in JavaScript" and scroll down to the second-ish answer.
Nov 19, 2015 at 16:28 comment added rayryeng @ΚριτικσιΛίθος The main page says... "Tips for golfing in JavaScript". This isn't JavaScript. You get a TypeError as @orlp stated. Try it yourself: ideone.com/IIYVUG
Nov 19, 2015 at 16:22 comment added user41805 @rayryeng I was referring to codegolf.stackexchange.com/a/11699/41805
Nov 19, 2015 at 15:10 comment added rayryeng @ΚριτικσιΛίθος I think you meant '0'. That doesn't save any bytes. In addition, the split method for strings requires a string as input.
Nov 19, 2015 at 10:47 comment added orlp @ΚριτικσιΛίθος That is a TypeError.
Nov 19, 2015 at 10:36 comment added user41805 You can use 0 for separating the countries and capitals. For example "...Nevada0Arstotzka".split(0)+[i] This saves two bytes.
Nov 19, 2015 at 7:02 comment added rayryeng I was wondering how to add or subtract based on the parity. That XORing is quite ingenious.
Nov 19, 2015 at 2:36 comment added Zach Gates You could just require the input have quotations (when using raw_input). @orlp
Nov 19, 2015 at 2:27 comment added orlp @sysreq Nope, then you need raw_input.
Nov 19, 2015 at 2:19 comment added cat If you switch to 2.7 you can eliminate parens in print() and everything else should still work
Nov 19, 2015 at 2:17 comment added cat aah, this is what I wanted to do with mine but I had no idea how. nice golfing, though!
Nov 19, 2015 at 1:49 history edited orlp CC BY-SA 3.0
deleted 10 characters in body
Nov 19, 2015 at 1:40 comment added Level River St Same trick as mine, different language. You beat me by 1 minute!
Nov 19, 2015 at 1:35 history answered orlp CC BY-SA 3.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /