aboutsummaryrefslogtreecommitdiff
path: root/semestr-4/aisd/pracownia4/gen.py
blob: 733a60edb2eb4e1bd4ab081a6ff8af6522e8dd8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from random import randint, seed, choice
import sys


seed(sys.argv[1])
n = int(sys.argv[2])
l = 0
print(n)


for i in range(n):
    c = choice('ISD')
    if l == 0:
        c = 'I'

    if c == 'D':
        print(c, randint(1, l))
        l -= 1
    elif c == 'I':
        print(c, randint(0, l), randint(-10, 10))
        l += 1
    else:
        a = randint(1, l)
        print(c, a, randint(a, l))