aboutsummaryrefslogtreecommitdiff
path: root/semestr-4/aisd/pracownia5/gen.py
blob: 85d332c6dd7d2bd58493d021d5a7651be7ecc538 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import random
import sys

random.seed(sys.argv[1])

n = int(sys.argv[2])
maxcoord = 200


print(n)
for i in range(n):
  ty = random.randint(0, 3)
  a, b = 0, 0
  y1, y2 = 0, 0
  if ty == 0:
    a = random.randint(0, maxcoord)
    b = random.randint(a+1, maxcoord + 1)
    y1 = random.randint(0, maxcoord)
    y2 = y1
  if ty == 1:
    y1 = random.randint(0, maxcoord)
    y2 = random.randint(a+1, maxcoord + 1)
    a = random.randint(0, maxcoord)
    b = a
  if ty == 2:
    a = random.randint(0, maxcoord)
    b = random.randint(0, maxcoord)
    x = random.randint(1, maxcoord)
    y1 = b
    b = a + x
    y2 = y1 + x
  if ty == 3:
    a = random.randint(0, maxcoord)
    b = random.randint(0, maxcoord)
    x = random.randint(1, maxcoord)
    y1 = b
    b = a + x
    y2 = y1 - x

  print(a, y1, b, y2)