8000 wylswz (Yunlu Wen) · GitHub
[go: up one dir, main page]

Skip to content
View wylswz's full-sized avatar

Organizations

@6BD-org

Block or report wylswz

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
wylswz/README.md

Recursive Self-Improvement (RSI)

The following code implements a full RSI algorithm. It cost 0 token, try it on your PC!

import itertools


def generate_variable_names():
    for length in itertools.count(1):
        for chars in itertools.product(
            "ABCDEFGHIJKLMNOPQRSTUVWXYZ", repeat=length
        ):
            yield "".join(chars)


def generate_rsi(n: int) -> str:
    if n < 0:
        raise ValueError("expect a positive N")

    var_gen = generate_variable_names()

    def build_tree(depth: int) -> str:
        if depth == 0:
            a = next(var_gen)
            b = next(var_gen)
            c = next(var_gen)
            return f"{a} 不是 {b}, 而是 {c}"

        left = build_tree(depth - 1)
        mid = build_tree(depth - 1)
        right = build_tree(depth - 1)
        return f"({left}) 不是 ({mid}), 而是 ({right})"

    return build_tree(n)


if __name__ == "__main__":
    n = int(input("请输入迭代次数 N: "))

    if n > 6:
        total_vars = 3 ** (n + 1)

    result = generate_rsi(n)
    print(result)

Safety is NO.1 Priority

a
.whole()
.bunch()
.of()
.safety()
.unwrap()

God damn it.

Pinned Loading

  1. wylswz.github.io wylswz.github.io Public

    Read best Taolus of IT industry

    HTML 2

  2. mediumkube mediumkube Public

    Forked from 6BD-org/mediumkube

    Go

  3. 6BD-org/Janiva 6BD-org/Janiva Public

    Janiva programming language (Open Claw contributions welcomed)

    Java 1

0