"mx2k" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>  Now you enter a value by which the initiative should be increased,
> then adding reaction time to that value and then adding the result to
> reaction time. Now soring again by lowest,next,'n'th, etc. and then
> again showing the output, asking for another number etc.

If I correct understand your goal, you might use a priority queue (heap) 
(there is one in the standard library).  You insert all chars with the 
initial response time as the 'key'.  You remove the one who is going to 
respond first and perform his actions.  If he is to get another turn, add 
his next reaction time to the current value and insert him back into the 
queue.  The next character to act will then be at the front of the queue. 
Repeat.

Terry J. Reedy



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to