Is there a way to use a foreach loop to iterate through a collection backwards or in a completely random order?
you can do it backwards:
for (int i=col.count-1; i>0; i--){
DoSomething ( col.item[i]) ;
}
Not certain about the exact syntax, but that's the paradigm.
As for completely random order, you can access a collection element via it's index. To ensure you hit every item, you would need to keep track of which elements you had already processed (probably by copying the collection and then removing the element after access).
EDIT: More details for random access The code for the random access could look something like this:
collection c = originalCollection;
while (c.count > 0) {
int i = randomNumber(seed) mod c.count
element d = c[i];
c.remove(d);
DoSomething(d);
}