From 50896f409ea74a20f732bc9b211a96ab969d6752 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sat, 19 Sep 2015 09:57:18 -0400 Subject: Fixed function length --- AutoVideosLive.py | 4 ++-- AutoVideosLiveBlackWhite.py | 2 +- 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: -- cgit v1.2.3