From 5d7775da938396b90166958a0908339f6b437b0c Mon Sep 17 00:00:00 2001 From: Aleksander Sadikov Date: Mon, 29 Feb 2016 01:07:53 +0100 Subject: Final hint added for sister/2. --- prolog/problems/family_relations/sister_2/common.py | 3 ++- prolog/problems/family_relations/sister_2/sl.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'prolog/problems') diff --git a/prolog/problems/family_relations/sister_2/common.py b/prolog/problems/family_relations/sister_2/common.py index 8493007..456ee97 100644 --- a/prolog/problems/family_relations/sister_2/common.py +++ b/prolog/problems/family_relations/sister_2/common.py @@ -28,6 +28,7 @@ hint_type = { 'neq_used_too_early': Hint('neq_used_too_early'), 'neq+_instead_of_neq': Hint('neq+_instead_of_neq'), 'predicate_always_false': Hint('predicate_always_false'), + 'final_hint': Hint('final_hint'), } test_cases = [ @@ -57,7 +58,7 @@ def test(code, aux_code): if engine_id: prolog.engine.destroy(engine_id) - hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_cases)}}] + hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_cases)}}, {'id': 'final_hint'}] return n_correct, len(test_cases), hints def hint(code, aux_code): diff --git a/prolog/problems/family_relations/sister_2/sl.py b/prolog/problems/family_relations/sister_2/sl.py index a1cf5c0..16ae999 100644 --- a/prolog/problems/family_relations/sister_2/sl.py +++ b/prolog/problems/family_relations/sister_2/sl.py @@ -69,5 +69,11 @@ ko naleti na primerjavo.

Vse kaže, da tvoj predikat vedno vrne "false". Si mu dal pravilno ime, si se morda pri imenu zatipkal?

Če je ime pravilno, se morda splača preveriti tudi, če se nisi zatipkal kje drugje, je morda kakšna pika namesto vejice ali obratno, morda kakšna spremenljivka z malo začetnico?

+''', + + 'final_hint': '''\ +

Pri tej nalogi si uporabil operator \==. Ta preverja, če njegova operanda nista enaka točno v tistem +trenutku, ko prolog naleti nanj. Če ga daš na začetek svoje rešitve, ta ne deluje kot bi si želel. +(Če želiš, lahko to seveda preveriš.)

''', } -- cgit v1.2.1