❔ Part of me feels like I need to learn System.Linq; one day
This is simple collision I wrote in few minutes for my game. I feel like I don't need to use
Math.Abs()
2 times, first to find and then to compare to number. Can I find index of minimum value using Linq
in some simple fancy one liner way?3 Replies
not that this is a good approach at all, but if you want one-liners...
I just wanted to avoid calling
Math.Abs()
function twice for no reason. I found this solution:
Is this better than original code? I am only using Math.Abs()
once to find the index of min number and using switch
instead of if else if
chain. It should be faster than original.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.