Okay I don't know any vb much less dot net, but if you think about the algorithm you should be able to formalize the code. If A is greater than B, then if C is greater than A you've sorted the number properly right? The else cases just do a few more comparisons to determine alternate orders. In psuedo-code
Code:
if ( a > b )
{
if ( c > a )
{
return c a b;
}
else
{
if ( c > b )
{
return a c b;
}
else
{
return a b c;
}
}
}
else
{
if ( c > b )
{
return c b a;
}
else
{
if ( c > a )
{
return b c a;
}
else
{
return b a c;
}
}
} Let me reinforce that this isn't legal vb code (I don't think) but it should illustrate the algorithm.