-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuzzset.py
More file actions
executable file
·35 lines (26 loc) · 888 Bytes
/
Copy pathfuzzset.py
File metadata and controls
executable file
·35 lines (26 loc) · 888 Bytes
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
#!/usr/bin/env python3
"""
Generate random triples of values for testing gcd_euclid() and gcd_lame()
Implementation (c) 2016,2017 Brig Young (github.com/Sonophoto)
License: BSD-2c, i.e. Cite.
"""
from math import gcd
from random import random
number_of_tuples = 20
""" Number of random tuples to create """
double_tuples = True
""" Create reverse tuples as well? i.e. (a,b)->(b,a) """
a_size = 1000
""" Range of a_size == 1 to (a_value-1) """
b_size = 100
""" Range of b_size == 1 to (b_value-1) """
fuzzies = []
""" This list collects the generated values """
for element in range(number_of_tuples):
a_value = int(random() * a_size)
b_value = int(random() * b_size)
gcd_value = gcd(a_value, b_value)
fuzzies.append((a_value, b_value, gcd_value))
fuzzies.append((b_value, a_value, gcd_value))
# Output, modify to suit your specific needs
print(fuzzies)