アットウィキロゴ

triangle

var triangle = (function () {
    function triangle() {
        this.x = new Array();
        this.y = new Array();
        this.number_dir = new Array();
        this.dir = new Array();
    }
    triangle.prototype.faststep = function () {
        var tx;
        var s;
        var sx;
        var t;
 
        tx = 0;
        for (s = 1; s < 11; s++) {
            for (sx = 1; sx < 11; sx++) {
                tx = tx + 1;
                this.x[tx] = s;
                this.y[tx] = sx;
            }
        }
 
        for (s = 1; s < 101; s++) {
            this.dir[s] = new Array();
        }
 
        var s1;
        var s2;
        var x1;
        var y1;
 
        for (t = 1; t < 101; t++) {
            tx = 0;
            for (s1 = -1; s1 < 2; s1++) {
                for (s2 = -1; s2 < 2; s2++) {
                    x1 = this.x[t] + s1;
                    y1 = this.y[t] + s2;
                    sx = this.search(x1, y1);
                    if (sx == t)
                        sx = 0;
                    if (sx > 0)
                        tx = tx + 1;
                    if (sx > 0)
                        this.dir[t][tx] = sx;
                }
            }
            this.number_dir[t] = tx;
        }
    };
 
    triangle.prototype.search = function (x1, y1) {
        var s;
        var sx;
        var h;
 
        sx = 0;
        for (s = 1; s < 101; s++) {
            h = 0;
            if (this.x[s] == x1)
                h = h + 1;
            if (this.y[s] == y1)
                h = h + 1;
            if (h == 2)
                sx = s;
        }
        return sx;
    };
    return triangle;
})();
//# sourceMappingURL=app.js.map
 
最終更新:2015年06月23日 15:08