CatForce port to INT attempt

A forum for topics that don't fit elsewhere. Introduce yourselves to other members of the forums, discuss how your name evolves when written out in the Game of Life, or just tell us how you found it. Forum rules still apply.
Post Reply
User avatar
pzq_alex
Posts: 801
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

CatForce port to INT attempt

Post by pzq_alex »

CatForce.zip
(152.08 KiB) Downloaded 50 times
A failed attempt to modify CatForce to run any INT rule (it's currently hardcoded to Glimmering Garden). However it doesn't work for some reason...
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?
User avatar
pzq_alex
Posts: 801
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

Re: CatForce port to INT attempt

Post by pzq_alex »

A version that can be run. No correctness or speed guarantees.
CatForce.zip
(247.4 KiB) Downloaded 82 times
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?
Para
Posts: 95
Joined: August 26th, 2023, 10:48 pm
Location: Somewhere

Re: CatForce port to INT attempt

Post by Para »

A rule-to-MAP table generator that feeds directly into the ntcatforce above.

Note that this does not take rulestrings, you have to manually set the transitions in the code and it will print the table in the browser console.
The documentation is in the code, and the rule is currently set to B3-e/S23.

Code: Select all

<!DOCTYPE html>
<html lang> 
    <head>
        <title>MAPGen</title>
    </head>
    <style>
    </style>
    <body>
    </body>
    <script>
        /*
            MAPGen
            SET(TRANSITION,VALUE) sets the transition TRANSITION (ex. B3y or S5e) to VALUE (1 for yes, the cell stays alive or 0 for no, it dies).
            SETALL(TRANSITION,VALUE) acts similarly to SET but it sets ALL transitions in TRANSITION to VALUE (ex. SETALL("B3",1) would set all transitions in B3 to alive).
        */
        let arr = new Array(512);
        for(let i = 0; i < 512; i ++){
            arr[i] = 0;
        }
        let Encode = function(string){
            string = string.replaceAll(" ","").replaceAll("\n","");
            let res = 0;
            for(let i = 0; i < 9; i ++){
                res += (+string[i]) * (2 ** (8 - i));
            }
            return res;
        };
        let Rot = function(string){
            return string[6]+string[3]+string[0]+string[7]+string[4]+string[1]+string[8]+string[5]+string[2];
        };
        let Ref = function(string){
            return string[2]+string[1]+string[0]+string[5]+string[4]+string[3]+string[8]+string[7]+string[6];
        };
        let Perms = function(string){
            string = string.replaceAll(" ","").replaceAll("\n","");
            return [
                string,
                Rot(string),
                Rot(Rot(string)),
                Rot(Rot(Rot(string))),
                Ref(string),
                Rot(Ref(string)),
                Rot(Rot(Ref(string))),
                Rot(Rot(Rot(Ref(string))))
            ];
        }
        let LOOKUP = {
            "0":`
            000
            000
            000
            `,
            "1e":`
            010
            000
            000
            `,
            "1c":`
            001
            000
            000
            `,
            "2c":`
            101
            000
            000
            `,
            "2e":`
            010
            001
            000
            `,
            "2k":`
            010
            000
            001
            `,
            "2a":`
            011
            000
            000
            `,
            "2i":`
            010
            000
            010
            `,
            "2n":`
            100
            000
            001
            `,
            "3c":`
            101
            000
            001
            `,
            "3e":`
            010
            101
            000
            `,
            "3k":`
            010
            100
            001
            `,
            "3a":`
            110
            100
            000
            `,
            "3i":`
            111
            000
            000
            `,
            "3n":`
            101
            001
            000
            `,
            "3y":`
            101
            000
            010
            `,
            "3q":`
            100
            001
            001
            `,
            "3j":`
            001
            001
            010
            `,
            "3r":`
            001
            101
            000
            `,
            "4c":`
            101
            000
            101
            `,
            "4e":`
            010
            101
            010
            `,
            "4k":`
            011
            100
            001
            `,
            "4a":`
            100
            100
            110
            `,
            "4i":`
            110
            000
            110
            `,
            "4n":`
            100
            100
            101
            `,
            "4y":`
            101
            000
            011
            `,
            "4q":`
            110
            100
            001
            `,
            "4j":`
            010
            101
            100
            `,
            "4r":`
            110
            101
            000
            `,
            "4t":`
            100
            101
            100
            `,
            "4w":`
            011
            100
            100
            `,
            "4z":`
            110
            000
            011
            `,
            "5c":`
            110
            101
            010
            `,
            "5e":`
            111
            000
            101
            `,
            "5k":`
            101
            001
            110
            `,
            "5a":`
            111
            100
            100
            `,
            "5i":`
            111
            101
            000
            `,
            "5n":`
            111
            001
            010
            `,
            "5y":`
            010
            101
            101
            `,
            "5q":`
            110
            100
            011
            `,
            "5j":`
            111
            100
            001
            `,
            "5r":`
            111
            000
            011
            `,
            "6c":`
            111
            101
            010
            `,
            "6e":`
            111
            100
            101
            `,
            "6k":`
            111
            100
            011
            `,
            "6a":`
            111
            100
            110
            `,
            "6i":`
            111
            000
            111
            `,
            "6n":`
            110
            101
            011
            `,
            "7e":`
            111
            101
            101
            `,
            "7c":`
            111
            101
            110
            `,
            "8":`
            111
            101
            111
            `,
        }

        let SET = function(token,val){
            if(token[0] != "B" && token[0] != "S"){
                throw `Error: Token does not start with B or S.`;
            }
            let off = 0;
            if(token[0] == "S"){
                off = 16;
            }
            token = token.slice(1);
            if(token in LOOKUP){
                let perm = Perms(LOOKUP[token]);
                for(let i = 0; i < 8; i ++){
                    arr[Encode(perm[i]) + off] = val;
                }
                return;
            }
            throw `Error: "${token}" does not exist.`;
        }
        let SETALL = function(token,val){
            if(token[0] != "B" && token[0] != "S"){
                throw `Error: Token does not start with B or S.`;
            }
            let off = 0;
            if(token[0] == "S"){
                off = 16;
            }
            if(+token[1] < 0 || +token[1] > 8){
                throw `Error: Amt. of neighbors is invalid.`;
            }
            token = +token[1];
            for(let i in LOOKUP){
                if(+i[0] == token){
                    let perm = Perms(LOOKUP[i]);
                    for(let j = 0; j < 8; j ++){
                        arr[Encode(perm[j]) + off] = val;
                    }
                }
            }
        }

        SETALL("B3",1);
        SET("B3e",0);
        SETALL("S2",1);
        SETALL("S3",1);
        console.log(arr.join(", "));
    </script>
</html>

Code: Select all

x = 9, y = 19, rule = B3-qy4e5j6i/S2-cn3-k4i
3$3bo$2b3o2$3bo$4b2o4$3bo$2b2o!
Post Reply