Create a [Snap!]! block named ! that moves the minimum number in that list to the first position and shifts the maximum number to the last one. During this process, your program should not change the order of all the other numbers of the list. Here is an example input list !
This is the output list !
Program Restrictions
It is a reporter block, and it returns the updated list.
The only parameter of the block is a list of numbers.
I think it would be best not to give people a solution to what's obviously a homework problem.
Instead, help by asking questions, starting with "what have you tried?" That will encourage people to struggle with the problem themselves before asking for help. Then, when they show you some code, ask questions to get them to think about what they're doing from a different perspective. For instance, if you were asking for help and posted that code, I'd say "Do you have to sort the list to find the largest item?" because your program does way more work than it has to.
P.S. Don't use BLOCK VARIABLES in that situation; use the SCRIPT VARIABLES block. With BLOCK VARIABLES, the second (and later) time you call the block, that variable starts with the value it had last time, instead of starting at 0 again.
Did I miss part of your message? I don't see a sorting algorithm.
By the way, the original problem is ambiguous about whether or not you're supposed to modify the original list. My instinct is not to, so I'd be inclined to write
assuming that the list items are unique.
It's not very efficient, since it traverses the list three times. But it can be tweaked to avoid that, and one of the traversals happens at primitive speed.