summaryrefslogtreecommitdiff
path: root/prolog/problems/family_relations/ancestor_2
diff options
context:
space:
mode:
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>
+''',
}