public Eq dsubstitute(Eq e, Eq newE) { Eq t = new Eq(this.operat, this.operand1, this.operand2); if (t.operat == "d") { return(new Eq("d", operand1.substitute(e, newE))); } else { if (this.operat != "") { if (operand1 != null) { if (!operand1.print().Equals(operand1.dsubstitute(e, newE).print())) { return(new Eq(this.operat, operand1.dsubstitute(e, newE), this.operand2)); } } if (operand2 != null) { if (!operand2.print().Equals(operand2.dsubstitute(e, newE).print())) { return(new Eq(this.operat, operand1, operand2.dsubstitute(e, newE))); } } } } return(t); }
public void substitutex(Eq eq) { string symbol; if (starAvailable) { symbol = "★"; starAvailable = false; substitutions = eq; } else { symbol = "◎"; substitutionc = eq; } currentEquation = currentEquation.dsubstitute(eq, new Eq(symbol)); currentFormula.text = currentEquation.print(); fullFormula.text += "\n" + currentEquation.print(); //SetTools(); }