title: Netlogo: "foreach" command with two lists
body: <p>I have a complete directed graph with each link a weight of it's own. I've managed to select the max-out-link of every turtle. But, sometimes the max-out-link of two turtles are opposite of each other resulting in both links opposite of one another being selected. if this happens i want the link with the lower value to die.
  i have created the two lists with this:</p>
  <pre><code>set max-end1  [[end1] of max-one-of my-out-links [trust]] of turtles
  set max-end2  [[end2] of max-one-of my-out-links [trust]] of turtles
  </code></pre>
  <p>and by setting an x and y parameter like so:</p>
  <pre><code>ask turtles
  [
  set x max-one-of my-out-links [label]
  set y my-in-links
  ]
  </code></pre>
  <p>i was hoping to compare each item of the two lists like so:</p>
  <pre><code>if [x] of max-end2 = any? [y] of max-end1
  [
  ifelse x X y
  [ask x [die]]
  [ask y [die]]
  ]
  </code></pre>
  <p>but i have no idea how to combine the foreach command with the if command
  can someone help me?</p>