from os import mkdir
from random import *

seed('valhalla')

MAXN = 50000

logger = lambda s : print (s)

class Printer:
    def __init__(self, path):
        self.path = "../" + path
        self.tests = 0
        try:
            logger("Creating directory %s"%self.path)
            mkdir(self.path)
        except:
            logger("...Directory already exists")

    def print(self, s, n, seed):
        self.tests += 1
        p = self.path + "/" + "%02d"%self.tests
        logger("Printing test %s"%p)
        out = open(p, "w")
        for i in [s, n, seed]:
            print (i, file=out)

tests = Printer("tests")

for s in ["Const1", "Const2", "Const3", "Random"]:
    for cnt in [1, 5, 10, 20, 100, 1000, MAXN]:
        tests.print(s, cnt, randint(1, 10**9))

for i in range(10):
    tests.print("Random", MAXN, randint(1, 10**9))

