From 5902e5a5c40ec8fa32c7af8d4bcc57134a0bea66 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 5 Jan 2016 18:36:37 +0100 Subject: Simplify Prolog hint functions --- prolog/problems/family_relations/grandparent_2/common.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'prolog/problems/family_relations/grandparent_2') diff --git a/prolog/problems/family_relations/grandparent_2/common.py b/prolog/problems/family_relations/grandparent_2/common.py index 663c9e4..eaae7a5 100644 --- a/prolog/problems/family_relations/grandparent_2/common.py +++ b/prolog/problems/family_relations/grandparent_2/common.py @@ -60,15 +60,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) # TODO: generic hint for: # TODO: parent(X, Z1), parent(Z2, Y), Z1 = Z2 -- cgit v1.2.1