diff options
Diffstat (limited to 'prolog/problems/family_relations/brother_2')
-rw-r--r-- | prolog/problems/family_relations/brother_2/common.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/prolog/problems/family_relations/brother_2/common.py b/prolog/problems/family_relations/brother_2/common.py index 556d0e9..876e3bc 100644 --- a/prolog/problems/family_relations/brother_2/common.py +++ b/prolog/problems/family_relations/brother_2/common.py @@ -56,15 +56,11 @@ def test(code, aux_code): hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_cases)}}] return passed, hints -def hint(program, solved_problems): - tokens = prolog.util.tokenize(program) - - code = (program + '\n' + - server.problems.solutions_for_problems('prolog', solved_problems) + '\n' + - server.problems.load_facts('prolog', facts).facts) +def hint(code, aux_code): + tokens = prolog.util.tokenize(code) try: - engine_id, output = prolog.engine.create(code=code, timeout=1.0) + engine_id, output = prolog.engine.create(code=code+aux_code, timeout=1.0) # X must be male if prolog.engine.ask_truth(engine_id, 'female(X), brother(X, _)'): |