コード例 #1
0
 public CalculateZeros(equation _e)
 {
     segmentWidth = 0.01d;
     epsilon      = 1E-15;
     zeros        = new List <Point>();
     f            = _e;
 }
コード例 #2
0
 public CalculateZeros(equation _e)
 {
     segmentWidth = 0.01d;
     epsilon = 1E-15;
     zeros = new List<Point>();
     f = _e;
 }
コード例 #3
0
ファイル: balloon.cs プロジェクト: andypondy/angrycats_unity
    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];
    }
コード例 #4
0
        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());
        }
コード例 #5
0
    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();
    }
コード例 #6
0
    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();
    }
コード例 #7
0
    /**
     * 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);
    }
コード例 #8
0
ファイル: equation.cs プロジェクト: andypondy/angrycats_unity
 public static void debugEq(equation eq)
 {
     Debug.Log("equation: #" + eq.id + ":" + eq.positionX + "+" + eq.positionY + "=" + eq.answer + ", status=" + eq.status);
 }
コード例 #9
0
 public void setEq(equation eq)
 {
     this.eq = eq;
     this.answerDisplay.text = this.eq.answer.ToString();
 }