aboutsummaryrefslogtreecommitdiffstats
path: root/ManyFunctionsGenerator.py
blob: b4f36af0ef7faa9687a7ed21710fd526810b94f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

n = 100

splitNumBegin = 128 - (n / 2)
i = 1

template = """
    function right{0}(uint seed) returns (uint) {{
        var r = nextRand(seed);
        if (r >= 2**{2})
            return right{1}(r);
        return left{1}(r);
    }}
    
    function left{0}(uint seed) returns (uint) {{
        var r = nextRand(nextRand(seed));
        if (r >= 2**{2})
            return left{1}(r);
        return right{1}(r);
    }}
"""

for i in range(1, n):
    print template.format(i, i + 1, i + splitNumBegin)