summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmonkey/monkey.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/monkey/monkey.py b/monkey/monkey.py
index 693aa67..9e70a3f 100755
--- a/monkey/monkey.py
+++ b/monkey/monkey.py
@@ -29,7 +29,7 @@ def score(program, lines):
return math.pow(result, 1/len(program))
# find a sequence of edits that fixes [code]
-def fix(name, code, edits, timeout=30, debug=False):
+def fix(name, code, edits, aux_code='', timeout=30, debug=False):
todo = PQueue() # priority queue of candidate solutions
done = set() # set of already-analyzed solutions
@@ -72,7 +72,7 @@ def fix(name, code, edits, timeout=30, debug=False):
# if the code is correct, we are done
try:
- if test(name, code):
+ if test(name, code + '\n' + aux_code):
return code, path, total_time, n_tested
except:
pass