mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 07:10:42 -08:00
Encapsulate formulae
This commit is contained in:
18
25_Chief/csharp/Math.cs
Normal file
18
25_Chief/csharp/Math.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using static Chief.Resources.Resource;
|
||||
|
||||
namespace Chief;
|
||||
|
||||
public static class Math
|
||||
{
|
||||
public static float CalculateOriginal(float result) => (result + 1 - 5) * 5 / 8 * 5 - 3;
|
||||
|
||||
public static string ShowWorking(float value) =>
|
||||
string.Format(
|
||||
Formats.Working,
|
||||
value,
|
||||
value += 3,
|
||||
value /= 5,
|
||||
value *= 8,
|
||||
value = value / 5 + 5,
|
||||
value - 1);
|
||||
}
|
||||
Reference in New Issue
Block a user