Skip to main content
10 events
when toggle format what by license comment
Dec 6, 2012 at 19:32 comment added user20284 Screen scrape google and other search engines (to double check).
Dec 6, 2012 at 10:12 comment added Maximus Minimus "I like this answer. It's the most elegant way to maximize your profits if you're being billed by the hour!" - or if you're being paid by lines of code. I shudder at the thought of a similar over-engineered solution to add 2 and 2!
Dec 6, 2012 at 3:13 comment added Panda Pajama I like this answer. It's the most elegant way to maximize your profits if you're being billed by the hour!
Dec 5, 2012 at 23:16 comment added RoundTower extra points to this solution for having White in the bottom left
Dec 5, 2012 at 22:50 comment added Rob Craig Being able to change the board is NOT one of the requirements, but going with this solution would imply that code bloat IS. There is no end to the reasons why a solution that adds another file, more memory, more CPU and I/O (!) is inappropriate when the original question included the phrase, "... and was wondering if there is an elegant algorithm".
Dec 5, 2012 at 21:11 comment added LarsH +1 - Elegance is not just in brevity. If being able to change board configurations is one of the requirements, this is a good way to go. I've done similar things in some puzzle programs. I wouldn't expect a chess program to have this requirement though. And I wouldn't agree that generalized solutions are always best. There is NO END to generalizations that could be made, such that you can't write Hello World without implementing an LALR parser and an OpenGL interpreter. The key is knowing when YAGNI.
Dec 5, 2012 at 14:22 comment added Chris Burt-Brown Hello, Kevin. You wrote The one-liners used in answers so far would have to be re-written. but also it's best to come up with generalized solutions like this instead of writing code that's difficult to change later. But you must understand that this code is much harder to tear down and rewrite than a single line. So I downvoted you because it isn't elegant or advisable to do this.
Dec 5, 2012 at 13:32 comment added Maximus Minimus Not enterprisey enough, needs more XML.
Dec 5, 2012 at 13:04 comment added avakar You should post this to thedailywtf.com. :)
Dec 5, 2012 at 11:27 history answered Kevin CC BY-SA 3.0