one of these photo sets is longer<div><br></div><div>WLOG we'll say urban has more (9)</div><div>while nature has less (6)</div><div><br></div><div>urban photos: U = [u1, u2, ... u6, ..., u9]</div><div>nature photos N = [n1, n2, ... n6]</div>
<div><br></div><div>we define an ordering on these</div><div><br></div><div>[u1,n1], [u2,n2], [u3,n3], [u4,n4], [u5,n5], [u6,n6], [u7,n1], [u8,n2], [u9,n3]</div><div>[u1,n2],[u2,n3], ... [u5,n6], [u6,n1], ... [u9,n4]</div>
<div>[u1,n3],....</div><div><br></div><div>namely we cycle over [u(i), n(i)]</div><div>when we run out of ns with start n from the beginning</div><div><br></div><div>then we shift the index on the ns</div><div><br></div>
<div>
[u(i), n(i+1)]</div><div>....</div><div><br></div><div>boom!</div><div><br></div><div>this is uniform when you have enough.</div><div><br><div class="gmail_quote">On 10 February 2011 19:21, Andrew Stewart <span dir="ltr"><<a href="mailto:boss@airbladesoftware.com">boss@airbladesoftware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hola El Rug,<br>
<br>
Here's a little teaser for you...<br>
<br>
I have two sets of photos; we'll call them urban and nature. Both sets contain about 6-9 photos, but not necessarily the same number.<br>
<br>
I also have about 15-20 pages on a site, spread more or less evenly across three sections. Each page has a title unique to its section (and, if it helps, we can assume unique across all the pages).<br>
<br>
On each page I want to display one photo from each set.<br>
<br>
The constraints in descending order are:<br>
<br>
* The code should change as little as possible when I add or remove a page or photo.<br>
* We should use each photo at least once.<br>
* A combination of [urban photo, nature photo] should not appear on more than one page.<br>
* And we should try to use all the photos roughly uniformly.<br>
<br>
Your time starts...now!<br>
<br>
Yours,<br>
Andy Stewart<br>
<br>
-------<br>
<a href="http://airbladesoftware.com" target="_blank">http://airbladesoftware.com</a><br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</blockquote></div><br></div>