public CalculateZeros(equation _e) { segmentWidth = 0.01d; epsilon = 1E-15; zeros = new List <Point>(); f = _e; }
public CalculateZeros(equation _e) { segmentWidth = 0.01d; epsilon = 1E-15; zeros = new List<Point>(); f = _e; }
public void setEq(equation eq) { this.eq = eq; this.equationDisplay.text = this.eq.equationString; // var randomIdx = Helpers.getRandomInt(0, this.spriteList.length); // var sprite = this.getComponent(cc.Sprite); // sprite.spriteFrame = this.spriteList[randomIdx]; }
public Point[] Calculate(IEquation e, double start, double end) { List <Point> results = new List <Point>(); equation ef = e.f; CalculateZeros cs = new CalculateZeros(ef); cs.FindZerosInRange(start, end); results = cs.Zeros; return(results.ToArray()); }
public void bombDefused(equation eq) { // do some damage to Boss this.bossHealth.takeDamage(this.bossDamage); // mark equation as solved this.equations[eq.id].status = equation.Status.solved; this.refToTileManager.setupAnswers(); this.destroyBomb(); }
public void bombMissed(equation eq) { // do some damage to Player this.playerHealth.takeDamage(this.bossDamage); // mark equation as missed this.equations[eq.id].status = equation.Status.missed; this.refToTileManager.setupAnswers(); this.destroyBomb(); }
/** * Math Manager */ private equation createMathEquation(int difficulty) { var x = Random.Range(1, 9); var y = Random.Range(1, 9); var answer = x + y; //generate unique id var eqString = "" + x + " + " + y; equation eq = new equation(this.equations.Count, x, y, answer, eqString, equation.Status.incomplete);//{x:x, y:y, answer:answer, eq: eq, id:this.equations.length, status:"incomplete"}; this.equations.Add(eq); return(eq); }
public static void debugEq(equation eq) { Debug.Log("equation: #" + eq.id + ":" + eq.positionX + "+" + eq.positionY + "=" + eq.answer + ", status=" + eq.status); }
public void setEq(equation eq) { this.eq = eq; this.answerDisplay.text = this.eq.answer.ToString(); }