07-04-2003, 11:52 PM
This is a fun little program that can be done in about 20 lines of code.
PURPOSE:
Given a queue of 4 entries, let the user select one of the entries to be moved to the top of the queue, rearranging all the other entries accordingly.
STARTING QUEUE...: 1 2 3 4
User selects #3.
UPDATED QUEUE....: 3 1 2 4
User selects #1.
UPDATED QUEUE....: 1 3 2 4
User selects #1.
UPDATED QUEUE....: 1 3 2 4 (the same, #1 was already at top)
You'll love it!
*****
PURPOSE:
Given a queue of 4 entries, let the user select one of the entries to be moved to the top of the queue, rearranging all the other entries accordingly.
STARTING QUEUE...: 1 2 3 4
User selects #3.
UPDATED QUEUE....: 3 1 2 4
User selects #1.
UPDATED QUEUE....: 1 3 2 4
User selects #1.
UPDATED QUEUE....: 1 3 2 4 (the same, #1 was already at top)
You'll love it!
*****