❔ comparing classes
I have a code that does a bit of math in a class and i want to compare 37 of these classes each having different base numbers and finding the worst and best, how can i do that
14 Replies
Is the only way to get a value out of those classes is have a variable outside of the classes and using it inside of them?
And if it is how am i supposed to find what numbers are the biggest
$details
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, and what you expect the result to be. Upload code here https://paste.mod.gg/ (see $code for more information on how to paste your code)
What kind of details
It pulls from hypixel web api, does some math and then writes some numbers
Do you have any examples of code?
PoC
And then that but 37 more times for each item
each having different base numbers and finding the worst and bestDo you mean sorting?
Yeah i guess
Instead of pumping out unorganized numbers to make it go from highest to lowest
https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.orderby?view=net-8.0
You can use this to sort a collection.
If that's what you want
I wanna take a list of numbers and sort from biggest to smallest
Yes, that function will do that exact thing.
Sorts the elements of a sequence in ascending order.
🤓
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.