fixed most obvious stuff #1
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
namespace Lunar.Evil_Calculator
|
||||
{
|
||||
internal static class ReverseNotationSolver
|
||||
internal static class ReversePolishNotationSolver
|
||||
{
|
||||
private static List<Token> ToReverseNotation(List<Token> equation)
|
||||
private static List<Token> ToReversePolishNotation(List<Token> equation)
|
||||
{
|
||||
List<Token> reversedEquation = new List<Token>();
|
||||
Stack<Token> operators = new Stack<Token>();
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
public static string Solve(List<Token> originalEquation)
|
||||
{
|
||||
List<Token> reversedEquation = ToReverseNotation(originalEquation);
|
||||
List<Token> reversedEquation = ToReversePolishNotation(originalEquation);
|
||||
Stack<Token> stack = new Stack<Token>();
|
||||
foreach (Token token in reversedEquation)
|
||||
{
|
||||
Reference in New Issue
Block a user