summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Sadikov <aleksander.sadikov@fri.uni-lj.si>2016-09-21 19:55:01 +0200
committerAleksander Sadikov <aleksander.sadikov@fri.uni-lj.si>2016-09-21 19:55:01 +0200
commit9e5d6dac0e32ecdce036041c878c290dc06599d9 (patch)
tree9f5abd15e8dd5ac3729f8e548796237e6d603144
parentb334f31758ea177028ba33648f6515edb282a0ce (diff)
English translation for isort/2 added.
-rw-r--r--prolog/problems/lists_advanced/len_2/en.py2
-rw-r--r--prolog/problems/lists_advanced/min_2/en.py2
-rw-r--r--prolog/problems/lists_advanced/rev_2/en.py2
-rw-r--r--prolog/problems/sorting/isort_2/en.py55
4 files changed, 57 insertions, 4 deletions
diff --git a/prolog/problems/lists_advanced/len_2/en.py b/prolog/problems/lists_advanced/len_2/en.py
index 6518eec..98eac2a 100644
--- a/prolog/problems/lists_advanced/len_2/en.py
+++ b/prolog/problems/lists_advanced/len_2/en.py
@@ -40,7 +40,7 @@ remember that unification is implicitly performed with the predicate's arguments
''',
'predicate_always_false': '''\
-<p>It seems your predicate is <emph>always</emph> "false". Did you give it the correct name,
+<p>It seems your predicate is <em>always</em> "false". Did you give it the correct name,
or is it perhaps misspelled?</p>
<p>If the name is correct, check whether something else is misspelled, perhaps there is a full stop instead of
a comma or vice versa, or maybe you typed a variable name in lowercase?</p>
diff --git a/prolog/problems/lists_advanced/min_2/en.py b/prolog/problems/lists_advanced/min_2/en.py
index 20677c6..4835d9d 100644
--- a/prolog/problems/lists_advanced/min_2/en.py
+++ b/prolog/problems/lists_advanced/min_2/en.py
@@ -46,7 +46,7 @@ remember that unification is implicitly performed with the predicate's arguments
''',
'predicate_always_false': '''\
-<p>It seems your predicate is <emph>always</emph> "false". Did you give it the correct name,
+<p>It seems your predicate is <em>always</em> "false". Did you give it the correct name,
or is it perhaps misspelled?</p>
<p>If the name is correct, check whether something else is misspelled, perhaps there is a full stop instead of
a comma or vice versa, or maybe you typed a variable name in lowercase?</p>
diff --git a/prolog/problems/lists_advanced/rev_2/en.py b/prolog/problems/lists_advanced/rev_2/en.py
index dbb08a2..790d664 100644
--- a/prolog/problems/lists_advanced/rev_2/en.py
+++ b/prolog/problems/lists_advanced/rev_2/en.py
@@ -44,7 +44,7 @@ remember that unification is implicitly performed with the predicate's arguments
''',
'predicate_always_false': '''\
-<p>It seems your predicate is <emph>always</emph> "false". Did you give it the correct name,
+<p>It seems your predicate is <em>always</em> "false". Did you give it the correct name,
or is it perhaps misspelled?</p>
<p>If the name is correct, check whether something else is misspelled, perhaps there is a full stop instead of
a comma or vice versa, or maybe you typed a variable name in lowercase?</p>
diff --git a/prolog/problems/sorting/isort_2/en.py b/prolog/problems/sorting/isort_2/en.py
index 71b1a12..35beb62 100644
--- a/prolog/problems/sorting/isort_2/en.py
+++ b/prolog/problems/sorting/isort_2/en.py
@@ -8,4 +8,57 @@ description = '''\
L = [1,2,3,4,5].
</pre>'''
-hint = {}
+plan = ['''\
+<p>When going through the list (actually when returning from recursion) at every step insert the current element
+in its proper position.</p>
+''', '''\
+<p>When going through the list at every step take away the head (it's stored on stack), while its tail goes
+into recursion (the problem/list is shorter, so this is possible). The recursion returns the <em>sorted</em>
+tail, and all that's left for you to do is to put the previously taken away head into its proper place in the
+sorted tail. Of course you can reuse some previous exercise for this task.</p>
+''', '''\
+<p>If list <code>L</code> is composed of head <code>H</code> and tail <code>T</code> and if we assume that
+tail <code>T</code> is correctly sorted into <code>SortedTail</code> by recursion, and if head <code>H</code>
+is inserted into its proper place within <code>SortedTail</code>, then we get the whole list <code>L</code>
+properly sorted.</p>
+''']
+
+hint = {
+ 'eq_instead_of_equ': '''\
+<p>The operator <code>==</code> is "stricter" than operator <code>=</code> in the sense that
+for the latter it is enough to be able to make the two operands equal (unification).</p>
+<p>Of course, you can also solve the exercise without explicit use of either of these two operators, just
+remember that unification is implicitly performed with the predicate's arguments (head of clause).</p>
+''',
+
+ 'eq_instead_of_equ_markup': '''\
+<p>Perhaps the operator for unification (=) would be better?</p>
+''',
+
+ 'base_case': '''\
+<p>Did you think of a base case? Which list can you sort without any effort whatsoever?</p>
+''',
+
+ 'recursive_case': '''\
+<p>The base case is ok. However, what about the general recursive case?</p>
+''',
+
+ 'predicate_always_false': '''\
+<p>It seems your predicate is <em>always</em> "false". Did you give it the correct name,
+or is it perhaps misspelled?</p>
+<p>If the name is correct, check whether something else is misspelled, perhaps there is a full stop instead of
+a comma or vice versa, or maybe you typed a variable name in lowercase?</p>
+<p>It is, of course, also possible that your conditions are too restrictive, or even impossible to satisfy
+(as would be, for example, the condition that <code>X</code> is <em>simultaneously</em> smaller and greater than
+<code>Y</code>, or something similarly impossible).</p>
+''',
+
+ 'timeout': '''\
+<p>Is there an infinite recursion at work here? How will it ever stop?</p>
+<p>Or perhaps is there a missing, faulty, or simply incompatible (with the general recursive case) base case?</p>
+''',
+
+ 'min_used': '''\
+<p>Try solving this exercise without using the predicate <code>min/2</code>.</p>
+''',
+}