From 8cbbbe0a57068556fb8195c8c47a998a51599d8d Mon Sep 17 00:00:00 2001 From: Aleksander Sadikov Date: Wed, 21 Sep 2016 23:34:56 +0200 Subject: English translation for slowest_sort_ever/2 added. --- prolog/problems/sorting/slowest_sort_ever_2/en.py | 44 ++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'prolog/problems') diff --git a/prolog/problems/sorting/slowest_sort_ever_2/en.py b/prolog/problems/sorting/slowest_sort_ever_2/en.py index 0e359b4..72a70bb 100644 --- a/prolog/problems/sorting/slowest_sort_ever_2/en.py +++ b/prolog/problems/sorting/slowest_sort_ever_2/en.py @@ -8,4 +8,46 @@ description = '''\ L = [1,2,3,4,5]. ''' -hint = {} +plan = ['''\ +

This exercise is mostly for fun... all you need are two lines, i.e. two prolog goals.

+''', '''\ +

Perhaps you can reuse some previous solutions?

+''', '''\ +

Which of the previous solutions has time complexity of O(n!)? Use it!

+'''] + +hint = { + 'eq_instead_of_equ': '''\ +

The operator == is "stricter" than operator = in the sense that +for the latter it is enough to be able to make the two operands equal (unification).

+

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).

+''', + + 'eq_instead_of_equ_markup': '''\ +

Perhaps the operator for unification (=) would be better?

+''', + + 'predicate_always_false': '''\ +

It seems your predicate is always "false". Did you give it the correct name, +or is it perhaps misspelled?

+

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?

+

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 X is simultaneously smaller and greater than +Y, or something similarly impossible).

+''', + + 'timeout': '''\ +

Is there an infinite recursion at work here? How will it ever stop?

+

Or perhaps is there a missing, faulty, or simply incompatible (with the general recursive case) base case?

+''', + + 'no_permute': '''\ +

Hmmm, which of the previous exercises has time complexity of O(n!)? How can you use it here?

+''', + + 'no_isSorted': '''\ +

You're on the right path, just a bit more to go. Perhaps you can reuse another previous exercise?

+''', +} -- cgit v1.2.1