From 8f065abb81d5709536814892799c6d2cf8a0bcff Mon Sep 17 00:00:00 2001 From: Timerix Date: Sun, 11 Jan 2026 02:54:43 +0500 Subject: [PATCH] it is reverse POLISH notation :nerdy-face: --- Evil Calculator/EquationManager.cs | 2 +- ...rseNotattionSolver.cs => ReversePolishNotationSolver.cs} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename Evil Calculator/{ReverseNotattionSolver.cs => ReversePolishNotationSolver.cs} (94%) diff --git a/Evil Calculator/EquationManager.cs b/Evil Calculator/EquationManager.cs index 4d29c7a..70e8973 100644 --- a/Evil Calculator/EquationManager.cs +++ b/Evil Calculator/EquationManager.cs @@ -144,7 +144,7 @@ { if (currentOperand != "") equation.Add(new Token(Token.TokenType.Operand, currentOperand)); buttonEquals.Text = "#"; - currentOperand = ReverseNotationSolver.Solve(equation); + currentOperand = ReversePolishNotationSolver.Solve(equation); UpdateLabels(); } } diff --git a/Evil Calculator/ReverseNotattionSolver.cs b/Evil Calculator/ReversePolishNotationSolver.cs similarity index 94% rename from Evil Calculator/ReverseNotattionSolver.cs rename to Evil Calculator/ReversePolishNotationSolver.cs index 0350ac2..8f47af1 100644 --- a/Evil Calculator/ReverseNotattionSolver.cs +++ b/Evil Calculator/ReversePolishNotationSolver.cs @@ -1,8 +1,8 @@ namespace Lunar.Evil_Calculator { - internal static class ReverseNotationSolver + internal static class ReversePolishNotationSolver { - private static List ToReverseNotation(List equation) + private static List ToReversePolishNotation(List equation) { List reversedEquation = new List(); Stack operators = new Stack(); @@ -47,7 +47,7 @@ public static string Solve(List originalEquation) { - List reversedEquation = ToReverseNotation(originalEquation); + List reversedEquation = ToReversePolishNotation(originalEquation); Stack stack = new Stack(); foreach (Token token in reversedEquation) {