summaryrefslogtreecommitdiff
path: root/prolog/problems/lists/divide_3
diff options
context:
space:
mode:
Diffstat (limited to 'prolog/problems/lists/divide_3')
-rw-r--r--prolog/problems/lists/divide_3/common.py10
-rw-r--r--prolog/problems/lists/divide_3/sl.py2
2 files changed, 6 insertions, 6 deletions
diff --git a/prolog/problems/lists/divide_3/common.py b/prolog/problems/lists/divide_3/common.py
index 34b7fe9..2d93c4c 100644
--- a/prolog/problems/lists/divide_3/common.py
+++ b/prolog/problems/lists/divide_3/common.py
@@ -88,7 +88,7 @@ def hint(code, aux_code):
# forcing result onto recursion; case of divide(T, [H1|L1], [H2|L2])
if not prolog.engine.ask_truthTO(engine_id, 'divide([a,b,c], _, _)') and \
prolog.engine.ask_truthTO(engine_id,
- 'asserta( divide([cob], [yowza,cob], [brix]) ), divide([yowza,brix,cob], [yowza,cob], [brix]), retract( divide([cob], [yowza,cob], [brix]) )'):
+ 'asserta( divide([cob], [yowza,cob], [brix]) ), divide([yowza,brix,cob], [cob], []), retract( divide([cob], [yowza,cob], [brix]) )'):
return [{'id': 'forcing_result_onto_recursion'}]
# base case succeeds with arbitrary result
@@ -108,10 +108,10 @@ def hint(code, aux_code):
if not prolog.engine.ask_truthTO(engine_id, 'divide([], [], [])'):
return [{'id': 'base_case'}]
- # target predicate seems to always be false
- if not prolog.engine.ask_truthTO(engine_id, 'divide([_,_,_,_,_], _, _)') and \
- not prolog.engine.ask_truthTO(engine_id, 'divide([_,_,_,_,_,_], _, _)'):
- return [{'id': 'predicate_always_false'}]
+# # target predicate seems to always be false
+# if not prolog.engine.ask_truthTO(engine_id, 'divide([_,_,_,_,_], _, _)') and \
+# not prolog.engine.ask_truthTO(engine_id, 'divide([_,_,_,_,_,_], _, _)'):
+# return [{'id': 'predicate_always_false'}]
# base cases work, the recursive doesn't (but it doesn't timeout)
# this may be left as the last, most generic hint
diff --git a/prolog/problems/lists/divide_3/sl.py b/prolog/problems/lists/divide_3/sl.py
index 93bc699..3a9e5c2 100644
--- a/prolog/problems/lists/divide_3/sl.py
+++ b/prolog/problems/lists/divide_3/sl.py
@@ -14,7 +14,7 @@ description = '''\
plan = ['''\
<p><img src="[%@resource plan.svg%]" /></p>
-<p>Saj veš kako je šlo v osnovni šoli: prvi, drugi, prvi.../p>
+<p>Saj veš kako je šlo v osnovni šoli: prvi, drugi, prvi, ...</p>
''', '''\
<p>Znaš vzeti dva elementa z začetka seznama? Vzorec je <code>[H1,H2|T]</code>.</p>
''', '''\