summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <leonardomtenenbaum@gmail.com>2015-09-19 09:57:18 -0400
committerpommicket <leonardomtenenbaum@gmail.com>2015-09-19 09:57:18 -0400
commit50896f409ea74a20f732bc9b211a96ab969d6752 (patch)
tree38a5c7cc79722666f5d6c812d234df2ce3f66814
parent06d2a1f6d78361f9410e3c4326554b4568efe91b (diff)
Fixed function length
-rw-r--r--AutoVideosLive.py4
-rw-r--r--AutoVideosLiveBlackWhite.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/AutoVideosLive.py b/AutoVideosLive.py
index e617291..ea0f0a7 100644
--- a/AutoVideosLive.py
+++ b/AutoVideosLive.py
@@ -28,7 +28,7 @@ binary = ['*', '+', '-'] #Operations for 2 numbers
numlist = ['x', 'y', 't', 'Constant']
-def randFunction(length, singleweight, numberweight):
+def randFunction(functionLength, singleweight, numberweight):
hasx = False
hasy = False
hast = False
@@ -43,7 +43,7 @@ def randFunction(length, singleweight, numberweight):
chanceend = 0
length = 1 #Number of operations done so far
while True:
- chanceend = (1.0 - (1.0 / length)) ** 12.0
+ chanceend = (1.0 - (1.0 / length)) ** (float(functionLength)/7)
if lasttype == 'n':
number = random.random()
if number < chanceend:
diff --git a/AutoVideosLiveBlackWhite.py b/AutoVideosLiveBlackWhite.py
index 33cf7db..1661ee1 100644
--- a/AutoVideosLiveBlackWhite.py
+++ b/AutoVideosLiveBlackWhite.py
@@ -43,7 +43,7 @@ def randFunction(length, singleweight, numberweight):
chanceend = 0
length = 1 #Number of operations done so far
while True:
- chanceend = (1.0 - (1.0 / length)) ** 12.0
+ chanceend = (1.0 - (1.0 / length)) ** (float(functionLength)/7)
if lasttype == 'n':
number = random.random()
if number < chanceend: