From 89b962e31b8d2dea124b8293b5d263f365d8bbeb Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 22 Jan 2015 16:40:14 +0100 Subject: Add support for hint generation --- monkey/monkey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'monkey') 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 -- cgit v1.2.1