Author Topic: Question on Ties  (Read 4713 times)

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Question on Ties
« on: December 21, 2006, 12:27:45 AM »
Proving there's always more to learn...  

Which tie exactly is acted upon, if all the ties have the same tie number? Assuming readtie/tienum match the tiepres number, does it go based on the last bot your bot tied to?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Question on Ties
« Reply #1 on: December 21, 2006, 01:00:41 AM »
I believe it's supposed to act on all of them.  If it doesn't, it probably acts on the first one with that designation (though this might not be true if you start forming and deleting ties).

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Question on Ties
« Reply #2 on: December 21, 2006, 11:23:06 AM »
I thought it just acted on the last tie given the number. Would be nice if it worked on all of them or we could use more than one tie per turn though.

PY kindly explained it to me before, IIRC it will address each of them in turn but only uses the last one because you can only use one tie per turn. Sort of like using two shoots or something, the program goes through the stages of using both but only the last shoot fires.

If I don't remember correctly then that's wrong.  
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Question on Ties
« Reply #3 on: December 21, 2006, 12:37:31 PM »
A quick look through the code shows that Nums is correct.  It acts upon all the ties with the same number.
« Last Edit: December 21, 2006, 12:37:50 PM by EricL »
Many beers....

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Question on Ties
« Reply #4 on: December 21, 2006, 03:36:17 PM »
You mean you can use more than one tie in a turn or that it acts upon all the ties with the same number but only does something with one of them? In which case is it the first or last tie created with that number?
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Question on Ties
« Reply #5 on: December 21, 2006, 05:07:52 PM »
It means tie operations such as .fixlen, .fixang, .deltie or sharing operate on all ties that have the same tie number as that placed in .tienum.  All the ties with that number will get lengthened or deleted or whatever all in that cycle.
Many beers....

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Question on Ties
« Reply #6 on: December 21, 2006, 05:29:25 PM »
Ooh cool,

There is some advantage to be had from giving the ties the same number then, what about things like .sharenrg or feeding through ties?

I really didn't think you could do anything with more than one tie per cycle.
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Question on Ties
« Reply #7 on: December 21, 2006, 05:35:45 PM »
I haven't looked exhaustivly or tested it, but it does appear that all tie operations use a while loop that interates through all ties and does what it does for all ties with the right number including sharing and feeding.
Many beers....