diff options
Diffstat (limited to 'prolog/problems/family_relations')
-rw-r--r-- | prolog/problems/family_relations/sister_2/common.py | 5 | ||||
-rw-r--r-- | prolog/problems/family_relations/sister_2/en.py | 23 |
2 files changed, 27 insertions, 1 deletions
diff --git a/prolog/problems/family_relations/sister_2/common.py b/prolog/problems/family_relations/sister_2/common.py index 2c9528e..9be9e6d 100644 --- a/prolog/problems/family_relations/sister_2/common.py +++ b/prolog/problems/family_relations/sister_2/common.py @@ -45,3 +45,8 @@ def test(program): prolog.engine.destroy(engine_id) return n_correct, len(queries) + +def hint(program): + if '\=' not in program and '\==' not in program: + return [{'id': 'x_y_must_be_different'}] + return None diff --git a/prolog/problems/family_relations/sister_2/en.py b/prolog/problems/family_relations/sister_2/en.py index d8395c0..629123c 100644 --- a/prolog/problems/family_relations/sister_2/en.py +++ b/prolog/problems/family_relations/sister_2/en.py @@ -11,4 +11,25 @@ description = '''\ X = patricia. </pre>''' -hint = {} +hint = { + 'x_y_must_be_different': '''\ +<p>What if <code>X</code> and <code>Y</code> are the same person? Try the +following query:</p> +<pre> +?- sister(sally, Y). +</pre> +''', + + # TODO move to generic prolog/en.py + 'no_hint': '''\ +<p>No hint available, sorry! Try to use thinking instead.</p> +''', + + # TODO move to generic prolog/en.py + 'syntax_error': '''\ +<p>Your code contains syntactic mistakes. The Prolog compiler emitted the following messages:</p> +<pre> +[%=messages%] +</pre> +''', +} |