New Chess960 goodie for generating a random starting position in chess96 #172

merged 3 commits into from May 3, 2013


None yet
2 participants

koosha-- commented Apr 1, 2013

Hi Dylan,

Please let me know your idea about the output format and its HTML version. I do not like the generated images but I couldn't find any other useful site for rendering.


majuscule commented Apr 6, 2013

Hi again Koosha!

Sorry for the wait in getting back to you here - I've had a lot on my plate. Off the bat I think it looks great. When you mentioned that you didn't like the images, I was fearing much worse. We actually had another attempt at a similar goodie using a perl module that was just hideous (the images, not the code :-)). Here the only thing that really strikes me is that the pieces aren't aliased, leaving jagged edges, but I think it's acceptable.

The one show-stopper is that images must be served through our /iu/?u=http://... endpoint. This is a privacy measure to avoid users from unwittingly sending third parties requests that can be used to track their activity. I looked through other goodies quickly to find an example, but it doesn't appear that any other goodies are serving images directly like this. Except for unicornify, which had this same mistake! I fixed it and made a new release of our goodies package. Anyway, there are a bunch of examples in spice, such as XKCD.

Is there any reason to limit this spice to chess960 positions? I also notice that you don't currently allow a position to be passed in, it'd be nice to have that option, even if I don't see it getting much use, it's very easy to implement.

Furthermore, I'd never heard of Chess960 before! It's cool though (I used to play a lottt of chess k-12). But I don't want this goodie to cover up our disambiguation results for chess and chess960 queries. Since at the moment it's giving a random position, how about adding that to the trigger?

Finally, with all of our plugins, we try to keep the headers standardized, i.e. <query> (Plugin Title). So I'd like to change that appropriately. This should result in a query like random chess position returning the header random position (Chess).

Let me know what you think!

And thank you again :-)


koosha-- commented Apr 14, 2013

Hi Dylan,

Thanks for your thorough explanation. I tried to address your comments to the extent I understood. However, I doubt that I understand your third paragraph (Is there any reason to...) well enough. If you think the comments in that paragraph are not addressed yet, you are free to address them.

Thanks a lot. ;-)


majuscule commented May 3, 2013

Hi again,

I've made a few changes to the text form output, as well as fixed an annoying little limitation of our image api I had forgotten about (it requires an image format extension, which luckily the api allowed me to append). I also added a test file, t/Chess960, and made one more change to the header, which now is in the form "random position (Chess960)", to keep only the plugin name alone in parentheses.

Now as for my third paragraph previously, I wasn't very clear so let me try again. Since the chessboard image api appears to accept any position to draw (not limited to chess960), it might be cool to expand this goodie to supply random chess positions in general. It's a little trickier than just random though unfortunately, because of course it would need to be a valid chess position, and the rules there are complex. I wonder if there's a CPAN module that might do something similar, but I doubt it.

This functionality however, is now complete, and tested with a deploy on (you can check it out right now, but I'm not sure how long I'll be able to keep it up there). I'm merging it into our master and closing this pull request right now, and I'll let you know as soon as itgoes live.

Thanks for writing this goodie! Let me know if you notice anything else you think worth changing :-)

@majuscule majuscule merged commit dcd8cf2 into duckduckgo:master May 3, 2013


koosha-- commented May 5, 2013

Thank you a lot. I just wondered now that it would be nice to output the position number (e.g. 540) when the user wants a random position. He then can memorize this number for future references. I'll make this change myself.

@koosha-- koosha-- deleted the koosha--:chess960 branch May 5, 2013


majuscule commented May 28, 2013

Hi Koosha,

I've deployed this goodie to If you think that including a position number would be helpful, please feel free to make the change and reopen or submit another pull request.

Thanks again!


koosha-- commented May 28, 2013

Hi Dylan,

Thank you for this too. I just found out that my Fibonacci goodie is deployed as well. When did that happen? I didn't get informed.


majuscule commented May 28, 2013

They were deployed simultaneously, I just hadn't gotten around to replying to all of them (there were others as well). You can check it out here.

Actually, that just made me notice a bug - it deployed without category metadata! We're supposed to have automated testing to ensure that that doesn't happen (notice the empty header above it). I'm fixing that now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment