We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Casting the return of Math.Log to float seemed to have better performance than using MathF functions. Once the log is an integer, then whether the log is odd or even determines the winner. Of course, using binary operations may offer improvement as well, but I'm going for the easiest to read solution that is still somewhat efficient. The logical flow is not optimized and is rather a reflection of how I am thinking through the problem.
Counter game
You are viewing a single comment's thread. Return to all comments →
Casting the return of Math.Log to float seemed to have better performance than using MathF functions. Once the log is an integer, then whether the log is odd or even determines the winner. Of course, using binary operations may offer improvement as well, but I'm going for the easiest to read solution that is still somewhat efficient. The logical flow is not optimized and is rather a reflection of how I am thinking through the problem.