summaryrefslogtreecommitdiff
path: root/prolog/problems/family_relations/ancestor_2
diff options
context:
space:
mode:
authorAleksander Sadikov <aleksander.sadikov@fri.uni-lj.si>2016-03-01 01:09:07 +0100
committerAleksander Sadikov <aleksander.sadikov@fri.uni-lj.si>2016-03-01 01:09:07 +0100
commit80881f3a6b05474fcd5afe7b3ed30cc7e75e4a92 (patch)
tree61c3d0e0fd6abc7110fb21bd7aacaa0efc3a1c38 /prolog/problems/family_relations/ancestor_2
parentf99c7db178964f641a422d4ad7cbe60e1483f3e5 (diff)
Improved hints for ancestor/2 and descendant/2.
Diffstat (limited to 'prolog/problems/family_relations/ancestor_2')
-rw-r--r--prolog/problems/family_relations/ancestor_2/common.py3
-rw-r--r--prolog/problems/family_relations/ancestor_2/sl.py4
2 files changed, 6 insertions, 1 deletions
diff --git a/prolog/problems/family_relations/ancestor_2/common.py b/prolog/problems/family_relations/ancestor_2/common.py
index d2e4f76..6690e00 100644
--- a/prolog/problems/family_relations/ancestor_2/common.py
+++ b/prolog/problems/family_relations/ancestor_2/common.py
@@ -29,6 +29,7 @@ hint_type = {
'ancestor_to_oneself': Hint('ancestor_to_oneself'),
'descendant_need_not_be_parent': Hint('descendant_need_not_be_parent'),
'wrong_direction': Hint('wrong_direction'),
+ 'timeout': Hint('timeout'),
}
test_cases = [
@@ -105,7 +106,7 @@ def hint(code, aux_code):
return [{'id': 'descendant_need_not_be_parent'}]
except socket.timeout as ex:
- pass
+ return [{'id': 'timeout'}]
finally:
if engine_id:
diff --git a/prolog/problems/family_relations/ancestor_2/sl.py b/prolog/problems/family_relations/ancestor_2/sl.py
index 081732b..03e9230 100644
--- a/prolog/problems/family_relations/ancestor_2/sl.py
+++ b/prolog/problems/family_relations/ancestor_2/sl.py
@@ -64,5 +64,9 @@ Skratka, poskusi prevesti na "manjši" problem, npr. prednik v enem koraku manj
<code>X</code> naj bo prednik od <code>Y</code> in ne obratno!</p>
<p><img src="[%@resource Prolog_ancestor_02.svg%]" /></p>
''',
+
+ 'timeout': '''\
+<p>Je morda na delu potencialno neskončna rekurzija?</p>
+''',
}