<div dir="ltr">I experimented with a bouncing atoms kind of system where atoms could collide and change direction. <div>I sorted atoms based on vertical position and tested collisions with a subset based on vertical position.</div><div>Then I could keep the collision testing to only a small number of atoms.</div><div><br></div><div>Best,</div><div>Karl</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 26, 2016 at 4:05 PM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A new version of Collections was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Collections-pre.679.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Collections-pre.679.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-pre.679<br>
Author: pre<br>
Time: 26 February 2016, 4:04:56.205127 pm<br>
UUID: 2ac5821c-d6f5-418c-ab07-ed3c2b9de62c<br>
Ancestors: Collections-eem.678<br>
<br>
This is a new iteration method which allows the iteration over asymmetric pairs. I have found this useful in game collision detections or duplicate detections. Alternatively we might want to take a second collection as input and create asymmetric pairs from self and this second collection.<br>
<br>
=============== Diff against Collections-eem.678 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Collection&gt;&gt;asymmetricPairsDo: (in category &#39;accessing&#39;) -----<br>
+ asymmetricPairsDo: aBlock<br>
+<br>
+       | iterationCollection currentElement |<br>
+       iterationCollection := self copy.<br>
+<br>
+       [currentElement := iterationCollection anyOne.<br>
+       iterationCollection remove: currentElement.<br>
+       iterationCollection isEmpty not]<br>
+               whileTrue: [ iterationCollection<br>
+                       do: [:element | aBlock value: currentElement value: element]].!<br>
<br>
<br>
</blockquote></div><br></div>