diff options
Diffstat (limited to 'impl/systems/generate-random.py')
-rw-r--r-- | impl/systems/generate-random.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/impl/systems/generate-random.py b/impl/systems/generate-random.py index cc67df2..66467b6 100644 --- a/impl/systems/generate-random.py +++ b/impl/systems/generate-random.py @@ -5,10 +5,12 @@ import random size = 10 def generate_variable(size): - return "x" + str(random.randint(1, size)) + if random.randint(1,3) == 1: + return "x" + str(random.randint(1, size)) + return str(random.randint(1,10)) def generate_expression(size): - if random.randint(1, 5) == 1: + if random.randint(1, 5) < 3: operator = random.choice(['+', '-']) return generate_variable(size) + operator + generate_expression(size); else: |