From 388b32039898cc8f1784378689007254eb7a33b6 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 13 Jan 2016 13:51:15 +0100 Subject: Remove space-padding from
 blocks

---
 prolog/problems/clp_fd/gcd_3/en.py                 |  4 +--
 prolog/problems/clp_fd/gcd_3/sl.py                 |  4 +--
 prolog/problems/clp_fd/magic_1/en.py               |  6 ++--
 prolog/problems/clp_fd/magic_1/sl.py               |  6 ++--
 prolog/problems/clp_fd/tobase_3/en.py              | 12 +++----
 prolog/problems/clp_fd/tobase_3/sl.py              | 12 +++----
 prolog/problems/clp_r/bounding_box_3/en.py         |  4 +--
 prolog/problems/clp_r/center_3/en.py               |  6 ++--
 prolog/problems/clp_r/max_sum_2/en.py              |  8 ++---
 prolog/problems/clp_r/megabytes_2/en.py            |  8 ++---
 prolog/problems/dcg/expr_3/en.py                   |  4 +--
 prolog/problems/dcg/expr_3/sl.py                   |  4 +--
 prolog/problems/dcg/number_3/en.py                 |  4 +--
 prolog/problems/dcg/number_3/sl.py                 |  4 +--
 prolog/problems/dcg/paren_3/en.py                  |  4 +--
 prolog/problems/dcg/paren_3/sl.py                  |  4 +--
 .../problems/denotational_semantics/algol_3/en.py  | 40 +++++++++++-----------
 .../denotational_semantics/algol_for_3/en.py       | 16 ++++-----
 .../denotational_semantics/algol_if_3/en.py        | 18 +++++-----
 .../denotational_semantics/prog_8puzzle_3/en.py    |  4 +--
 .../denotational_semantics/prog_listswap_3/en.py   |  4 +--
 prolog/problems/family_relations/ancestor_2/en.py  |  8 ++---
 prolog/problems/family_relations/ancestor_2/sl.py  |  8 ++---
 prolog/problems/family_relations/aunt_2/en.py      |  6 ++--
 prolog/problems/family_relations/aunt_2/sl.py      |  6 ++--
 prolog/problems/family_relations/brother_2/en.py   |  6 ++--
 prolog/problems/family_relations/brother_2/sl.py   |  6 ++--
 prolog/problems/family_relations/connected_3/en.py |  8 ++---
 prolog/problems/family_relations/cousin_2/en.py    |  6 ++--
 prolog/problems/family_relations/cousin_2/sl.py    |  6 ++--
 .../problems/family_relations/descendant_2/en.py   |  8 ++---
 .../problems/family_relations/descendant_2/sl.py   |  8 ++---
 prolog/problems/family_relations/father_2/en.py    | 10 +++---
 prolog/problems/family_relations/father_2/sl.py    | 10 +++---
 .../problems/family_relations/grandparent_2/en.py  | 10 +++---
 .../problems/family_relations/grandparent_2/sl.py  | 10 +++---
 prolog/problems/family_relations/mother_2/en.py    | 10 +++---
 prolog/problems/family_relations/mother_2/sl.py    | 10 +++---
 prolog/problems/family_relations/sister_2/en.py    |  4 +--
 prolog/problems/family_relations/sister_2/sl.py    |  4 +--
 .../license_plates/checklicenseplate_3/en.py       | 14 ++++----
 .../license_plates/checklicenseplate_3/sl.py       | 14 ++++----
 prolog/problems/license_plates/firstminus_2/en.py  |  6 ++--
 prolog/problems/license_plates/firstminus_2/sl.py  |  6 ++--
 prolog/problems/license_plates/genexp_2/en.py      | 16 ++++-----
 prolog/problems/license_plates/genexp_2/sl.py      | 16 ++++-----
 prolog/problems/license_plates/getdigits_2/en.py   |  4 +--
 prolog/problems/license_plates/getdigits_2/sl.py   |  4 +--
 prolog/problems/license_plates/joindigits_2/en.py  | 10 +++---
 prolog/problems/license_plates/joindigits_2/sl.py  | 10 +++---
 prolog/problems/lists/conc_3/en.py                 |  8 ++---
 prolog/problems/lists/conc_3/sl.py                 |  8 ++---
 prolog/problems/lists/count_3/en.py                |  4 +--
 prolog/problems/lists/count_3/sl.py                |  4 +--
 prolog/problems/lists/del_3/en.py                  | 18 +++++-----
 prolog/problems/lists/del_3/sl.py                  | 18 +++++-----
 prolog/problems/lists/divide_3/en.py               |  8 ++---
 prolog/problems/lists/divide_3/sl.py               |  8 ++---
 prolog/problems/lists/dup_2/en.py                  |  8 ++---
 prolog/problems/lists/dup_2/sl.py                  |  8 ++---
 prolog/problems/lists/evenlen_1_+_oddlen_1/en.py   | 12 +++----
 prolog/problems/lists/evenlen_1_+_oddlen_1/sl.py   | 12 +++----
 prolog/problems/lists/insert_3/en.py               |  8 ++---
 prolog/problems/lists/insert_3/sl.py               |  8 ++---
 prolog/problems/lists/len_2/en.py                  |  4 +--
 prolog/problems/lists/len_2/sl.py                  |  4 +--
 prolog/problems/lists/max_2/en.py                  |  8 ++---
 prolog/problems/lists/max_2/sl.py                  |  8 ++---
 prolog/problems/lists/memb_2/en.py                 | 12 +++----
 prolog/problems/lists/memb_2/sl.py                 | 12 +++----
 prolog/problems/lists/min_2/en.py                  |  8 ++---
 prolog/problems/lists/min_2/sl.py                  |  8 ++---
 prolog/problems/lists/palindrome_1/en.py           |  8 ++---
 prolog/problems/lists/palindrome_1/sl.py           |  8 ++---
 prolog/problems/lists/permute_2/en.py              | 14 ++++----
 prolog/problems/lists/permute_2/sl.py              | 14 ++++----
 prolog/problems/lists/rev_2/en.py                  |  8 ++---
 prolog/problems/lists/rev_2/sl.py                  |  8 ++---
 prolog/problems/lists/shiftleft_2/en.py            |  4 +--
 prolog/problems/lists/shiftleft_2/sl.py            |  4 +--
 prolog/problems/lists/shiftright_2/en.py           |  4 +--
 prolog/problems/lists/shiftright_2/sl.py           |  4 +--
 prolog/problems/lists/sublist_2/en.py              | 16 ++++-----
 prolog/problems/lists/sublist_2/sl.py              | 16 ++++-----
 prolog/problems/lists/sum_2/en.py                  |  4 +--
 prolog/problems/lists/sum_2/sl.py                  |  4 +--
 prolog/problems/old_exams/pascal_3/en.py           | 24 ++++++-------
 prolog/problems/other/genlist_4/en.py              |  4 +--
 prolog/problems/sets/diff_3/en.py                  |  4 +--
 prolog/problems/sets/diff_3/sl.py                  |  4 +--
 prolog/problems/sets/intersect_3/en.py             |  4 +--
 prolog/problems/sets/intersect_3/sl.py             |  4 +--
 prolog/problems/sets/is_subset_2/en.py             |  8 ++---
 prolog/problems/sets/is_subset_2/sl.py             |  8 ++---
 prolog/problems/sets/is_superset_2/en.py           |  8 ++---
 prolog/problems/sets/is_superset_2/sl.py           |  8 ++---
 prolog/problems/sets/powerset_2/en.py              |  4 +--
 prolog/problems/sets/powerset_2/sl.py              |  4 +--
 prolog/problems/sets/subset_2/en.py                | 18 +++++-----
 prolog/problems/sets/subset_2/sl.py                | 18 +++++-----
 prolog/problems/sets/union_3/en.py                 |  4 +--
 prolog/problems/sets/union_3/sl.py                 |  4 +--
 prolog/problems/sorting/is_sorted_1/en.py          |  8 ++---
 prolog/problems/sorting/is_sorted_1/sl.py          |  8 ++---
 prolog/problems/sorting/isort_2/en.py              |  4 +--
 prolog/problems/sorting/isort_2/sl.py              |  4 +--
 prolog/problems/sorting/pivoting_4/en.py           |  4 +--
 prolog/problems/sorting/pivoting_4/sl.py           |  4 +--
 prolog/problems/sorting/quick_sort_2/en.py         |  4 +--
 prolog/problems/sorting/quick_sort_2/sl.py         |  4 +--
 prolog/problems/sorting/sins_3/en.py               |  8 ++---
 prolog/problems/sorting/sins_3/sl.py               |  8 ++---
 prolog/problems/sorting/slowest_sort_ever_2/en.py  |  4 +--
 prolog/problems/sorting/slowest_sort_ever_2/sl.py  |  4 +--
 prolog/problems/trees/deletebt_3/en.py             |  8 ++---
 prolog/problems/trees/depthbt_2/en.py              |  4 +--
 prolog/problems/trees/insertbt_3/en.py             | 10 +++---
 prolog/problems/trees/maxt_2/en.py                 |  4 +--
 prolog/problems/trees/memberbt_2/en.py             |  8 ++---
 prolog/problems/trees/membert_2/en.py              |  8 ++---
 prolog/problems/trees/mirrorbt_2/en.py             |  4 +--
 prolog/problems/trees/numberbt_2/en.py             |  4 +--
 prolog/problems/trees/tolistbt_2/en.py             |  4 +--
 123 files changed, 489 insertions(+), 489 deletions(-)

(limited to 'prolog')

diff --git a/prolog/problems/clp_fd/gcd_3/en.py b/prolog/problems/clp_fd/gcd_3/en.py
index 7953eb1..8891d54 100644
--- a/prolog/problems/clp_fd/gcd_3/en.py
+++ b/prolog/problems/clp_fd/gcd_3/en.py
@@ -7,8 +7,8 @@ description = '''\
 

gcd(X, Y, GCD): GCD is the greatest common divisor of X and Y. Implement this predicate using constraints.

Hint: try writing a predicate to find all common divisors of two numbers first.

-  ?- gcd(36, 84, GCD).
-    GCD = 12.
+?- gcd(36, 84, GCD).
+  GCD = 12.
 
''' hint = {} diff --git a/prolog/problems/clp_fd/gcd_3/sl.py b/prolog/problems/clp_fd/gcd_3/sl.py index 9ef1a87..f5016fa 100644 --- a/prolog/problems/clp_fd/gcd_3/sl.py +++ b/prolog/problems/clp_fd/gcd_3/sl.py @@ -7,8 +7,8 @@ description = '''\

gcd(X, Y, GCD): GCD je največji skupni delitelj števil X in Y. Implementiraj ta predikat z uporabo omejitev.

Namig: poskusi najprej napisati predikat, ki poišče vse skupne delitelje dveh števil.

-  ?- gcd(36, 84, GCD).
-    GCD = 12.
+?- gcd(36, 84, GCD).
+  GCD = 12.
 
''' hint = {} diff --git a/prolog/problems/clp_fd/magic_1/en.py b/prolog/problems/clp_fd/magic_1/en.py index c8b5a1a..0798164 100644 --- a/prolog/problems/clp_fd/magic_1/en.py +++ b/prolog/problems/clp_fd/magic_1/en.py @@ -6,9 +6,9 @@ slug = 'generate a 3x3 magic square' description = '''\

magic(S): the list S represents a 3×3 magic square (S is a permutation of numbers 1 to 9 - three numbers for each row). The sums of numbers in each row, column and diagonal of a magic squre are equal. Implement this predicate using constraints. Your code should return all possible solutions.

-  ?- magic(S).
-    S = [2, 7, 6, 9, 5, 1, 4, 3, 8] ;
-    …
+?- magic(S).
+  S = [2, 7, 6, 9, 5, 1, 4, 3, 8] ;
+  …
 
''' hint = {} diff --git a/prolog/problems/clp_fd/magic_1/sl.py b/prolog/problems/clp_fd/magic_1/sl.py index 8cf040e..fa73a01 100644 --- a/prolog/problems/clp_fd/magic_1/sl.py +++ b/prolog/problems/clp_fd/magic_1/sl.py @@ -6,9 +6,9 @@ slug = '3x3 magični kvadrat' description = '''\

magic(S): seznam S predstavlja 3×3 magični kvadrat (S je permutacija števil 1 do 9 -- tri števila tvorijo eno vrstico). Vsote števil v vsaki vrstici, stolpcu in glavni diagonali magičnega kvadrata so enake. Implementiraj ta predikat z uporabo omejitev. Predikat naj vrne vse rešitve, eno po eno.

-  ?- magic(S).
-    S = [2, 7, 6, 9, 5, 1, 4, 3, 8] ;
-    …
+?- magic(S).
+  S = [2, 7, 6, 9, 5, 1, 4, 3, 8] ;
+  …
 
''' hint = {} diff --git a/prolog/problems/clp_fd/tobase_3/en.py b/prolog/problems/clp_fd/tobase_3/en.py index c05ab2a..41f8889 100644 --- a/prolog/problems/clp_fd/tobase_3/en.py +++ b/prolog/problems/clp_fd/tobase_3/en.py @@ -6,12 +6,12 @@ slug = 'convert numbers from/to the decimal system' description = '''\

tobase(Number, B, X): given a Number in the decimal system (base 10), X represents the same number in the system with base B. Implement this predicate using constraints. Limit the value of B to the interval [2..10].

-  ?- tobase(42, 2, X).
-    X = 101010.
-  ?- tobase(N, 2, 101010).
-    N = 42.
-  ?- tobase(42, B, 101010).
-    B = 2.
+?- tobase(42, 2, X).
+  X = 101010.
+?- tobase(N, 2, 101010).
+  N = 42.
+?- tobase(42, B, 101010).
+  B = 2.
 
''' hint = {} diff --git a/prolog/problems/clp_fd/tobase_3/sl.py b/prolog/problems/clp_fd/tobase_3/sl.py index a775808..72879af 100644 --- a/prolog/problems/clp_fd/tobase_3/sl.py +++ b/prolog/problems/clp_fd/tobase_3/sl.py @@ -6,12 +6,12 @@ slug = 'Pretvori števila v/iz desetiškega sistema' description = '''\

tobase(Number, B, X): število Number je v desetiškem sistemu. X predstavlja to število v sistemu z bazo B. Implementiraj predikat z uporabo omejitev. Omeji vrednost B na interval [2..10].

-  ?- tobase(42, 2, X).
-    X = 101010.
-  ?- tobase(N, 2, 101010).
-    N = 42.
-  ?- tobase(42, B, 101010).
-    B = 2.
+?- tobase(42, 2, X).
+  X = 101010.
+?- tobase(N, 2, 101010).
+  N = 42.
+?- tobase(42, B, 101010).
+  B = 2.
 
''' hint = {} diff --git a/prolog/problems/clp_r/bounding_box_3/en.py b/prolog/problems/clp_r/bounding_box_3/en.py index 8c6a9f7..efb7a55 100644 --- a/prolog/problems/clp_r/bounding_box_3/en.py +++ b/prolog/problems/clp_r/bounding_box_3/en.py @@ -6,8 +6,8 @@ slug = 'find the smallest bounding box' description = '''\

bounding_box(Points, X1/Y1, X2/Y2): X1/Y1 and X2/Y2 are the bottom-left and top-right points defining the smallest bounding box containing all points in the list Points.

-  ?- bounding_box([4.5/2.3, 3.6/1.2, 6.7/0.1], X1/Y1, X2/Y2).
-    X1 = 3.6, Y1 = 0.1, X2 = 6.7, Y2 = 2.3.
+?- bounding_box([4.5/2.3, 3.6/1.2, 6.7/0.1], X1/Y1, X2/Y2).
+  X1 = 3.6, Y1 = 0.1, X2 = 6.7, Y2 = 2.3.
 
''' hint = {} diff --git a/prolog/problems/clp_r/center_3/en.py b/prolog/problems/clp_r/center_3/en.py index ae5aeb8..e6ca645 100644 --- a/prolog/problems/clp_r/center_3/en.py +++ b/prolog/problems/clp_r/center_3/en.py @@ -6,9 +6,9 @@ slug = 'find central points' description = '''\

center(Points, R, X/Y): X/Y is a point in the list Points that is at most R away from all other points.

-  ?- center([1.0/1.1, 2.0/2.1, 3.0/3.1, 4.0/4.1], 4.0, X/Y).
-    X = 2.0, Y = 2.1 ;
-    X = 3.0, Y = 3.1.
+?- center([1.0/1.1, 2.0/2.1, 3.0/3.1, 4.0/4.1], 4.0, X/Y).
+  X = 2.0, Y = 2.1 ;
+  X = 3.0, Y = 3.1.
 
''' hint = {} diff --git a/prolog/problems/clp_r/max_sum_2/en.py b/prolog/problems/clp_r/max_sum_2/en.py index eeff4cd..269f8b3 100644 --- a/prolog/problems/clp_r/max_sum_2/en.py +++ b/prolog/problems/clp_r/max_sum_2/en.py @@ -6,10 +6,10 @@ slug = 'find maximal adjacent elements' description = '''\

max_sum(List, Max): Max is the maximal sum of two adjacent elements in List.

-  ?- max_sum([4.5, 3.6, 1.2, 6.7], Max).
-    Max = 8.1.
-  ?- max_sum([1.1, 1.2, -12.3, 8.8], Max).
-    Max = 2.3.
+?- max_sum([4.5, 3.6, 1.2, 6.7], Max).
+  Max = 8.1.
+?- max_sum([1.1, 1.2, -12.3, 8.8], Max).
+  Max = 2.3.
 
''' hint = {} diff --git a/prolog/problems/clp_r/megabytes_2/en.py b/prolog/problems/clp_r/megabytes_2/en.py index 01fdfff..27919dc 100644 --- a/prolog/problems/clp_r/megabytes_2/en.py +++ b/prolog/problems/clp_r/megabytes_2/en.py @@ -6,10 +6,10 @@ slug = 'convert mebibytes to megabytes' description = '''\

A megabyte is the SI unit meaning 106 bytes, while a mebibyte is the IEC unit meaning 220 bytes. Write the predicate megabytes(SI, IEC) that converts between the two using constraints.

-  ?- megabytes(2, IEC).
-    IEC = 1.9073486328125.
-  ?- megabytes(SI, 2).
-    SI = 2.097152.
+?- megabytes(2, IEC).
+  IEC = 1.9073486328125.
+?- megabytes(SI, 2).
+  SI = 2.097152.
 
''' hint = {} diff --git a/prolog/problems/dcg/expr_3/en.py b/prolog/problems/dcg/expr_3/en.py index 298ebeb..f853ad2 100644 --- a/prolog/problems/dcg/expr_3/en.py +++ b/prolog/problems/dcg/expr_3/en.py @@ -7,8 +7,8 @@ description = '''\

Write a DCG with the starting symbol expr for the language of arithmetic expressions consisting of numbers (without leading zeros), addition and multiplication. Subexpressions can be grouped using parentheses. The meaning of a word in this language is the numeric value of the represented arithmetic expression.

Example words: (1+2)*3, 42*8*3, (2+1)*(3+4).

-  ?- expr(N, ['(',2,'+',1,')','*','(',3,'+',4,')'], []).  % (2+1)*(3+4) = 21
-    N = 21.
+?- expr(N, ['(',2,'+',1,')','*','(',3,'+',4,')'], []).  % (2+1)*(3+4) = 21
+  N = 21.
 
''' diff --git a/prolog/problems/dcg/expr_3/sl.py b/prolog/problems/dcg/expr_3/sl.py index 734a6ea..23fed26 100644 --- a/prolog/problems/dcg/expr_3/sl.py +++ b/prolog/problems/dcg/expr_3/sl.py @@ -7,8 +7,8 @@ description = '''\

Napiši gramatiko z začetnim simbolom expr za jezik aritmetičnih izrazov, ki vsebujejo števila (brez vodilnih ničel), vsoto in množenje. Podizrazi se lahko združujejo z oklepaji. Pomen besede v tem jeziku je numerična vrednost predstavljenega izraza.

Primeri veljavnih besed: (1+2)*3, 42*8*3, (2+1)*(3+4).

-  ?- expr(N, ['(',2,'+',1,')','*','(',3,'+',4,')'], []).  % (2+1)*(3+4) = 21
-    N = 21.
+?- expr(N, ['(',2,'+',1,')','*','(',3,'+',4,')'], []).  % (2+1)*(3+4) = 21
+  N = 21.
 
''' diff --git a/prolog/problems/dcg/number_3/en.py b/prolog/problems/dcg/number_3/en.py index c2f9c3d..6516db7 100644 --- a/prolog/problems/dcg/number_3/en.py +++ b/prolog/problems/dcg/number_3/en.py @@ -6,8 +6,8 @@ slug = 'numbers with meaning' description = '''\

Write a DCG with the starting symbol number for the language of non-negative integers. The numbers may contain leading zeros. The meaning of a word in this language is the numeric value of the represented number.

-  ?- number(N, [1,2,3,4], []).
-    N = 1234.
+?- number(N, [1,2,3,4], []).
+  N = 1234.
 
''' diff --git a/prolog/problems/dcg/number_3/sl.py b/prolog/problems/dcg/number_3/sl.py index eeb4db2..bcb2cf4 100644 --- a/prolog/problems/dcg/number_3/sl.py +++ b/prolog/problems/dcg/number_3/sl.py @@ -6,8 +6,8 @@ slug = 'Števila s pomenom' description = '''\

Napiši gramatiko z začetnim simbolom number za jezik nenegativnih celih števil. Števila lahko vsebujejo vodilne ničle. Pomen besede v tem jeziku je kar numerična vrednost predstavljenega števila.

-  ?- number(N, [1,2,3,4], []).
-    N = 1234.
+?- number(N, [1,2,3,4], []).
+  N = 1234.
 
''' diff --git a/prolog/problems/dcg/paren_3/en.py b/prolog/problems/dcg/paren_3/en.py index 56519ff..4a8e0a8 100644 --- a/prolog/problems/dcg/paren_3/en.py +++ b/prolog/problems/dcg/paren_3/en.py @@ -6,8 +6,8 @@ slug = 'properly nested parens with meaning' description = '''\

Write a DCG with the starting symbol paren for the language of properly nested sequences of parentheses. The meaning of a word in this language is the maximum depth of the nested parentheses.

-  ?- paren(D, ['(','(',')',')','(',')'], []).  % (())()
-    D = 2.
+?- paren(D, ['(','(',')',')','(',')'], []).  % (())()
+  D = 2.
 
''' diff --git a/prolog/problems/dcg/paren_3/sl.py b/prolog/problems/dcg/paren_3/sl.py index a98eb8b..d721506 100644 --- a/prolog/problems/dcg/paren_3/sl.py +++ b/prolog/problems/dcg/paren_3/sl.py @@ -6,8 +6,8 @@ slug = 'Pravilno gnezdeni oklepaji s pomenom' description = '''\

Napiši gramatiko z začetnim simbolom paren za jezik pravilno gnezdenih zaporedij oklepajev. Pomen besede v tem jeziku je največja globina gnezdenja oklepajev.

-  ?- paren(D, ['(','(',')',')','(',')'], []).  % (())()
-    D = 2.
+?- paren(D, ['(','(',')',')','(',')'], []).  % (())()
+  D = 2.
 
''' diff --git a/prolog/problems/denotational_semantics/algol_3/en.py b/prolog/problems/denotational_semantics/algol_3/en.py index c5da13e..59a9bd2 100644 --- a/prolog/problems/denotational_semantics/algol_3/en.py +++ b/prolog/problems/denotational_semantics/algol_3/en.py @@ -6,28 +6,28 @@ slug = 'interpreter for mini-algol' description = '''\

A DCG for mini-algol.

-  % apply a function to a starting state
-  ?- apply([a=2], Out, fun(_In, Out, eval(a+3, _In, Out))).
-    Out = 5.
+% apply a function to a starting state
+?- apply([a=2], Out, fun(_In, Out, eval(a+3, _In, Out))).
+  Out = 5.
 
-  % a := a+b
-  % b := a-b
-  % a := a-b
-  ?- _Program = [begin,a,:=,a+b,b,:=,a-b,a,:=,a-b,end],
-      algol(_F, _Program, []),
-      apply([a=3,b=5], Output, _F).
-    Output = [a=5,b=3,printout=[]].
+% a := a+b
+% b := a-b
+% a := a-b
+?- _Program = [begin,a,:=,a+b,b,:=,a-b,a,:=,a-b,end],
+    algol(_F, _Program, []),
+    apply([a=3,b=5], Output, _F).
+  Output = [a=5,b=3,printout=[]].
 
-  % a := 0
-  % while a < 10 do
-  % begin
-  %   print(a)
-  %   a := a+1
-  % end
-  ?- _Program = [begin,a,:=,0,while,a,<,10,do,begin,print(a),a,:=,a+1,end,end],
-      algol(_F, _Program, []),
-      apply([a=3], Output, _F).
-    Output = [a=10,printout=[0,1,2,3,4,5,6,7,8,9]].
+% a := 0
+% while a < 10 do
+% begin
+%   print(a)
+%   a := a+1
+% end
+?- _Program = [begin,a,:=,0,while,a,<,10,do,begin,print(a),a,:=,a+1,end,end],
+    algol(_F, _Program, []),
+    apply([a=3], Output, _F).
+  Output = [a=10,printout=[0,1,2,3,4,5,6,7,8,9]].
 
''' diff --git a/prolog/problems/denotational_semantics/algol_for_3/en.py b/prolog/problems/denotational_semantics/algol_for_3/en.py index d4b8144..91ff34d 100644 --- a/prolog/problems/denotational_semantics/algol_for_3/en.py +++ b/prolog/problems/denotational_semantics/algol_for_3/en.py @@ -6,14 +6,14 @@ slug = 'interpreter for mini-algol with for-statement' description = '''\

Extend the given DCG for mini-algol to support the for-statement. Example:

-  % for a := 0 & a < 5 & a := a + 1 do
-  % begin
-  %   print(a)
-  % end
-  ?- _Program = [begin,for,a,:=,0,&,a,<,5,&,a,:=,a+1,do,begin,print(a),end,end],
-      algol_for(_F, _Program, []),
-      apply([a=2], Output, _F).
-    Output = [a=5,printout=[0,1,2,3,4]].
+% for a := 0 & a < 5 & a := a + 1 do
+% begin
+%   print(a)
+% end
+?- _Program = [begin,for,a,:=,0,&,a,<,5,&,a,:=,a+1,do,begin,print(a),end,end],
+    algol_for(_F, _Program, []),
+    apply([a=2], Output, _F).
+  Output = [a=5,printout=[0,1,2,3,4]].
 
''' diff --git a/prolog/problems/denotational_semantics/algol_if_3/en.py b/prolog/problems/denotational_semantics/algol_if_3/en.py index fae6c45..66855e5 100644 --- a/prolog/problems/denotational_semantics/algol_if_3/en.py +++ b/prolog/problems/denotational_semantics/algol_if_3/en.py @@ -6,15 +6,15 @@ slug = 'interpreter for mini-algol with if-statement' description = '''\

Extend the given DCG for mini-algol to support the if-statement. You can assume that both branches are present in every if-statement. Example:

-  % if a < b then
-  %   print(a)
-  % else
-  %   print(b)
-  % end
-  ?- _Program = [begin,if,a,<,b,then,print(a),else,print(b),end,end],
-      algol_if(_F, _Program, []),
-      apply([a=3,b=5], Output, _F).
-    Output = [a=3,b=5,printout=[3]].
+% if a < b then
+%   print(a)
+% else
+%   print(b)
+% end
+?- _Program = [begin,if,a,<,b,then,print(a),else,print(b),end,end],
+    algol_if(_F, _Program, []),
+    apply([a=3,b=5], Output, _F).
+  Output = [a=3,b=5,printout=[3]].
 
''' diff --git a/prolog/problems/denotational_semantics/prog_8puzzle_3/en.py b/prolog/problems/denotational_semantics/prog_8puzzle_3/en.py index 1c23b18..6a31496 100644 --- a/prolog/problems/denotational_semantics/prog_8puzzle_3/en.py +++ b/prolog/problems/denotational_semantics/prog_8puzzle_3/en.py @@ -9,8 +9,8 @@ description = '''\

The meaning of a word (program) in this language has the form In-->Out, mapping from input to output states. Each state is a (permuted) list of numbers from 0 to 8, where 0 stands for the empty square and other numbers for the corresponding tiles. The first three numbers in the list correspond to the top row of the 8-puzzle, the next three numbers to the middle row, and the last three numbers to the last row. The meaning of instructions left, right, up and down is to move the blank tile in the given direction.

-  ?- prog_8puzzle([0,1,2,3,4,5,6,7,8]-->Out, [begin,down,right,end], []).
-    Out = [3,1,2,4,0,5,6,7,8].
+?- prog_8puzzle([0,1,2,3,4,5,6,7,8]-->Out, [begin,down,right,end], []).
+  Out = [3,1,2,4,0,5,6,7,8].
 

Helper predicates (already defined):
diff --git a/prolog/problems/denotational_semantics/prog_listswap_3/en.py b/prolog/problems/denotational_semantics/prog_listswap_3/en.py index 5e85ce6..ad9dcf8 100644 --- a/prolog/problems/denotational_semantics/prog_listswap_3/en.py +++ b/prolog/problems/denotational_semantics/prog_listswap_3/en.py @@ -9,8 +9,8 @@ description = '''\

The meaning of a word (program) in this language has the form In-->Out, mapping from input to output lists. Besides the list contents, internal states also hold the current cursor position. The left and right instructions move the cursor one step in the given direction, while the swap instruction swaps the element under the cursor with its left neighbor (and fails if cursor is currently pointing to the first element of the list).

-  ?- prog_listswap([1,2,3,4]-->Out, [begin,right,swap,end], []).
-    Out = [2,1,3,4].
+?- prog_listswap([1,2,3,4]-->Out, [begin,right,swap,end], []).
+  Out = [2,1,3,4].
 

Helper predicate (already defined):
diff --git a/prolog/problems/family_relations/ancestor_2/en.py b/prolog/problems/family_relations/ancestor_2/en.py index 29fb253..588de83 100644 --- a/prolog/problems/family_relations/ancestor_2/en.py +++ b/prolog/problems/family_relations/ancestor_2/en.py @@ -6,10 +6,10 @@ slug = 'the ancestor relation' description = '''\

ancestor(X, Y): X is an ancestor (parent, grandparent,...) of Y.

-  ?- ancestor(patricia, X).
-    X = john ;
-    X = michael ;
-    X = michelle.
+?- ancestor(patricia, X).
+  X = john ;
+  X = michael ;
+  X = michelle.
 
''' hint = {} diff --git a/prolog/problems/family_relations/ancestor_2/sl.py b/prolog/problems/family_relations/ancestor_2/sl.py index b0fae7c..9e5c9bf 100644 --- a/prolog/problems/family_relations/ancestor_2/sl.py +++ b/prolog/problems/family_relations/ancestor_2/sl.py @@ -6,10 +6,10 @@ slug = 'X je prednik od Y' description = '''\

ancestor(X, Y): X je prednik (oče, mama, dedek, ...) od Y.

-  ?- ancestor(patricia, X).
-    X = john ;
-    X = michael ;
-    X = michelle.
+?- ancestor(patricia, X).
+  X = john ;
+  X = michael ;
+  X = michelle.
 
''' plan = ['''\ diff --git a/prolog/problems/family_relations/aunt_2/en.py b/prolog/problems/family_relations/aunt_2/en.py index 25cac41..7e508bc 100644 --- a/prolog/problems/family_relations/aunt_2/en.py +++ b/prolog/problems/family_relations/aunt_2/en.py @@ -6,9 +6,9 @@ slug = 'the aunt relation' description = '''\

aunt(X, Y): X is an aunt of Y.

-  ?- aunt(sally, X).
-    X = vanessa ;
-    X = patricia.
+?- aunt(sally, X).
+  X = vanessa ;
+  X = patricia.
 
''' hint = {} diff --git a/prolog/problems/family_relations/aunt_2/sl.py b/prolog/problems/family_relations/aunt_2/sl.py index e5c3bb9..eb1b673 100644 --- a/prolog/problems/family_relations/aunt_2/sl.py +++ b/prolog/problems/family_relations/aunt_2/sl.py @@ -6,9 +6,9 @@ slug = 'X je teta od Y' description = '''\

aunt(X, Y): X je teta od Y.

-  ?- aunt(sally, X).
-    X = vanessa ;
-    X = patricia.
+?- aunt(sally, X).
+  X = vanessa ;
+  X = patricia.
 
''' plan = ['''\ diff --git a/prolog/problems/family_relations/brother_2/en.py b/prolog/problems/family_relations/brother_2/en.py index 2daf78f..a461ba8 100644 --- a/prolog/problems/family_relations/brother_2/en.py +++ b/prolog/problems/family_relations/brother_2/en.py @@ -6,9 +6,9 @@ slug = 'the brother relation' description = '''\

brother(X, Y): X is a brother of Y.

-  ?- brother(jeffrey, X).
-    X = william ;
-    X = sally.
+?- brother(jeffrey, X).
+  X = william ;
+  X = sally.
 
''' hint = {} diff --git a/prolog/problems/family_relations/brother_2/sl.py b/prolog/problems/family_relations/brother_2/sl.py index 29703a1..29ec289 100644 --- a/prolog/problems/family_relations/brother_2/sl.py +++ b/prolog/problems/family_relations/brother_2/sl.py @@ -6,9 +6,9 @@ slug = 'X je brat od Y' description = '''\

brother(X, Y): X je brat od Y.

-  ?- brother(jeffrey, X).
-    X = william ;
-    X = sally.
+?- brother(jeffrey, X).
+  X = william ;
+  X = sally.
 
''' plan = [ diff --git a/prolog/problems/family_relations/connected_3/en.py b/prolog/problems/family_relations/connected_3/en.py index f50d60e..932d4cf 100644 --- a/prolog/problems/family_relations/connected_3/en.py +++ b/prolog/problems/family_relations/connected_3/en.py @@ -6,10 +6,10 @@ slug = 'check if two people are connected in the family tree' description = '''\

connected(X, Y, N): X and Y are connected with a series of (no more than N) parent/child relations.

-  ?- connected(ana, morty, 10).
-    false.
-  ?- connected(ana, margaret, 10).
-    true.
+?- connected(ana, morty, 10).
+  false.
+?- connected(ana, margaret, 10).
+  true.
 
''' hint = {} diff --git a/prolog/problems/family_relations/cousin_2/en.py b/prolog/problems/family_relations/cousin_2/en.py index cf628db..93e3aee 100644 --- a/prolog/problems/family_relations/cousin_2/en.py +++ b/prolog/problems/family_relations/cousin_2/en.py @@ -6,9 +6,9 @@ slug = 'the cousin relation' description = '''\

cousin(X, Y): X is a cousin (male or female) of Y.

-  ?- cousin(andrew, X).
-    X = vanessa ;
-    X = patricia.
+?- cousin(andrew, X).
+  X = vanessa ;
+  X = patricia.
 
''' hint = {} diff --git a/prolog/problems/family_relations/cousin_2/sl.py b/prolog/problems/family_relations/cousin_2/sl.py index 7bd819a..5e18f4a 100644 --- a/prolog/problems/family_relations/cousin_2/sl.py +++ b/prolog/problems/family_relations/cousin_2/sl.py @@ -6,9 +6,9 @@ slug = 'X je bratranec ali sestrična od Y' description = '''\

cousin(X, Y): X je bratranec ali sestrična od Y.

-  ?- cousin(andrew, X).
-    X = vanessa ;
-    X = patricia.
+?- cousin(andrew, X).
+  X = vanessa ;
+  X = patricia.
 
''' plan = ['''\ diff --git a/prolog/problems/family_relations/descendant_2/en.py b/prolog/problems/family_relations/descendant_2/en.py index 74360f3..2bd30af 100644 --- a/prolog/problems/family_relations/descendant_2/en.py +++ b/prolog/problems/family_relations/descendant_2/en.py @@ -6,10 +6,10 @@ slug = 'the descendant relation' description = '''\

descendant(X, Y): X is a descendant (child, grandchild,...) of Y.

-  ?- descendant(patricia, X).
-    X = william ;
-    X = tina ;
-    X = thomas.
+?- descendant(patricia, X).
+  X = william ;
+  X = tina ;
+  X = thomas.
 
''' hint = {} diff --git a/prolog/problems/family_relations/descendant_2/sl.py b/prolog/problems/family_relations/descendant_2/sl.py index 5f4a3ca..993b4bb 100644 --- a/prolog/problems/family_relations/descendant_2/sl.py +++ b/prolog/problems/family_relations/descendant_2/sl.py @@ -6,10 +6,10 @@ slug = 'the descendant relation' description = '''\

descendant(X, Y): X is a descendant (child, grandchild,...) of Y.

-  ?- descendant(patricia, X).
-    X = william ;
-    X = tina ;
-    X = thomas.
+?- descendant(patricia, X).
+  X = william ;
+  X = tina ;
+  X = thomas.
 
''' plan = ['''\ diff --git a/prolog/problems/family_relations/father_2/en.py b/prolog/problems/family_relations/father_2/en.py index bde9a2d..31517c9 100644 --- a/prolog/problems/family_relations/father_2/en.py +++ b/prolog/problems/family_relations/father_2/en.py @@ -6,11 +6,11 @@ slug = 'the father-child relation' description = '''\

father(X, Y): X is the father of Y.

-  ?- father(thomas, william).
-    true.
-  ?- father(aleksander, X).
-    X = luana ;
-    X = daniela.
+?- father(thomas, william).
+  true.
+?- father(aleksander, X).
+  X = luana ;
+  X = daniela.
 
''' hint = {} diff --git a/prolog/problems/family_relations/father_2/sl.py b/prolog/problems/family_relations/father_2/sl.py index 7b37aba..fed61c7 100644 --- a/prolog/problems/family_relations/father_2/sl.py +++ b/prolog/problems/family_relations/father_2/sl.py @@ -6,11 +6,11 @@ slug = 'X je oče od Y' description = '''\

father(X, Y): X je oče od Y.

-  ?- father(thomas, william).
-    true.
-  ?- father(aleksander, X).
-    X = luana ;
-    X = daniela.
+?- father(thomas, william).
+  true.
+?- father(aleksander, X).
+  X = luana ;
+  X = daniela.
 
''' plan = [ diff --git a/prolog/problems/family_relations/grandparent_2/en.py b/prolog/problems/family_relations/grandparent_2/en.py index c181ab5..11918a9 100644 --- a/prolog/problems/family_relations/grandparent_2/en.py +++ b/prolog/problems/family_relations/grandparent_2/en.py @@ -6,11 +6,11 @@ slug = 'the grandparent relation' description = '''\

grandparent(P, C): P is a grandparent of C.

-  ?- grandparent(tina, X).
-    X = vanessa ;
-    X = patricia.
-  ?- grandparent(tina, vanessa).
-    true.
+?- grandparent(tina, X).
+  X = vanessa ;
+  X = patricia.
+?- grandparent(tina, vanessa).
+  true.
 
''' hint = {} diff --git a/prolog/problems/family_relations/grandparent_2/sl.py b/prolog/problems/family_relations/grandparent_2/sl.py index 2246ae6..d74f4f4 100644 --- a/prolog/problems/family_relations/grandparent_2/sl.py +++ b/prolog/problems/family_relations/grandparent_2/sl.py @@ -6,11 +6,11 @@ slug = 'X je dedek ali babica od Y' description = '''\

grandparent(X, Y): X je dedek ali babica od Y.

-  ?- grandparent(tina, X).
-    X = vanessa ;
-    X = patricia.
-  ?- grandparent(tina, vanessa).
-    true.
+?- grandparent(tina, X).
+  X = vanessa ;
+  X = patricia.
+?- grandparent(tina, vanessa).
+  true.
 
''' plan = ['''\ diff --git a/prolog/problems/family_relations/mother_2/en.py b/prolog/problems/family_relations/mother_2/en.py index 722c016..531c3d7 100644 --- a/prolog/problems/family_relations/mother_2/en.py +++ b/prolog/problems/family_relations/mother_2/en.py @@ -6,11 +6,11 @@ slug = 'the mother-child relation' description = '''\

mother(M, C): M is the mother of C.

-  ?- mother(tina, william).
-    true.
-  ?- mother(nevia, X).
-    X = luana ;
-    X = daniela.
+?- mother(tina, william).
+  true.
+?- mother(nevia, X).
+  X = luana ;
+  X = daniela.
 
''' hint = {} diff --git a/prolog/problems/family_relations/mother_2/sl.py b/prolog/problems/family_relations/mother_2/sl.py index b37c20c..5869033 100644 --- a/prolog/problems/family_relations/mother_2/sl.py +++ b/prolog/problems/family_relations/mother_2/sl.py @@ -6,11 +6,11 @@ slug = 'X je mama od Y' description = '''\

mother(X, Y): X je mama od Y.

-  ?- mother(tina, william).
-    true.
-  ?- mother(nevia, X).
-    X = luana ;
-    X = daniela.
+?- mother(tina, william).
+  true.
+?- mother(nevia, X).
+  X = luana ;
+  X = daniela.
 
''' plan = [ diff --git a/prolog/problems/family_relations/sister_2/en.py b/prolog/problems/family_relations/sister_2/en.py index 32bb9d9..a7e2035 100644 --- a/prolog/problems/family_relations/sister_2/en.py +++ b/prolog/problems/family_relations/sister_2/en.py @@ -6,8 +6,8 @@ slug = 'the sister relation' description = '''\

sister(X, Y): X is a sister of Y.

-  ?- sister(vanessa, X).
-    X = patricia.
+?- sister(vanessa, X).
+  X = patricia.
 
''' hint = { diff --git a/prolog/problems/family_relations/sister_2/sl.py b/prolog/problems/family_relations/sister_2/sl.py index cb51592..5ca9928 100644 --- a/prolog/problems/family_relations/sister_2/sl.py +++ b/prolog/problems/family_relations/sister_2/sl.py @@ -6,8 +6,8 @@ slug = 'X je sestra od Y' description = '''\

sister(X, Y): X je sestra od Y.

-  ?- sister(vanessa, X).
-    X = patricia.
+?- sister(vanessa, X).
+  X = patricia.
 
''' plan = [ diff --git a/prolog/problems/license_plates/checklicenseplate_3/en.py b/prolog/problems/license_plates/checklicenseplate_3/en.py index 76270cd..927c261 100644 --- a/prolog/problems/license_plates/checklicenseplate_3/en.py +++ b/prolog/problems/license_plates/checklicenseplate_3/en.py @@ -6,13 +6,13 @@ slug = 'check if the numbers in a license plate form an equation' description = '''\

checkLicensePlate(LP, E1, E2): the digits in the list LP can be combined into a valid equation E1 = E2. E1 and E2 are arithmetic expressions, obtained from sublists of Plate by inserting arithmetic operators (+, -, * and /) between elements. An additional unary minus can be inserted before the leftmost number of E1 and E2.

-  ?- checkLicensePlate([l,j,l,3,-,2,1,7], E1, E2).
-    E1 = 3,       E2 = 21/7 ;
-    E1 = -3,      E2 = -21/7 ;
-    E1 = 3*2,     E2 = -1+7 ;
-    E1 = -3*2,    E2 = 1-7 ;
-    E1 = 3*2+1,   E2 = 7 ;
-    E1 = -3*2-1,  E2 = -7.
+?- checkLicensePlate([l,j,l,3,-,2,1,7], E1, E2).
+  E1 = 3,       E2 = 21/7 ;
+  E1 = -3,      E2 = -21/7 ;
+  E1 = 3*2,     E2 = -1+7 ;
+  E1 = -3*2,    E2 = 1-7 ;
+  E1 = 3*2+1,   E2 = 7 ;
+  E1 = -3*2-1,  E2 = -7.
 
''' hint = {} diff --git a/prolog/problems/license_plates/checklicenseplate_3/sl.py b/prolog/problems/license_plates/checklicenseplate_3/sl.py index 2e3ec65..92578d4 100644 --- a/prolog/problems/license_plates/checklicenseplate_3/sl.py +++ b/prolog/problems/license_plates/checklicenseplate_3/sl.py @@ -6,13 +6,13 @@ slug = 'Preveri, če lahko iz številk v registrski tablici sestaviš veljavno e description = '''\

checkLicensePlate(LP, E1, E2): iz cifer v seznamu LP se da sestaviti veljavno enačbo E1 = E2. E1 in E2 sta aritmetična izraza, sestavljena iz podseznamov Plate z uporabo aritmetičnih operatorjev (+, -, * and /). Dodaten unarni minus se lahko vstavi na začetek izrazov E1 in E2.

-  ?- checkLicensePlate([l,j,l,3,-,2,1,7], E1, E2).
-    E1 = 3,       E2 = 21/7 ;
-    E1 = -3,      E2 = -21/7 ;
-    E1 = 3*2,     E2 = -1+7 ;
-    E1 = -3*2,    E2 = 1-7 ;
-    E1 = 3*2+1,   E2 = 7 ;
-    E1 = -3*2-1,  E2 = -7.
+?- checkLicensePlate([l,j,l,3,-,2,1,7], E1, E2).
+  E1 = 3,       E2 = 21/7 ;
+  E1 = -3,      E2 = -21/7 ;
+  E1 = 3*2,     E2 = -1+7 ;
+  E1 = -3*2,    E2 = 1-7 ;
+  E1 = 3*2+1,   E2 = 7 ;
+  E1 = -3*2-1,  E2 = -7.
 
''' hint = {} diff --git a/prolog/problems/license_plates/firstminus_2/en.py b/prolog/problems/license_plates/firstminus_2/en.py index cea521a..f939c91 100644 --- a/prolog/problems/license_plates/firstminus_2/en.py +++ b/prolog/problems/license_plates/firstminus_2/en.py @@ -6,9 +6,9 @@ slug = 'negate the first element in a list of numbers' description = '''\

firstMinus(L1, L2): the list L2 is the same as L1, except for the first element that may be negated. Your code should return both solutions.

-  ?- firstMinus([1,2,3], L).
-    L = [1,2,3] ;
-    L = [-1,2,3].
+?- firstMinus([1,2,3], L).
+  L = [1,2,3] ;
+  L = [-1,2,3].
 
''' hint = {} diff --git a/prolog/problems/license_plates/firstminus_2/sl.py b/prolog/problems/license_plates/firstminus_2/sl.py index d480994..6186302 100644 --- a/prolog/problems/license_plates/firstminus_2/sl.py +++ b/prolog/problems/license_plates/firstminus_2/sl.py @@ -6,9 +6,9 @@ slug = 'Negiraj prvi element v danem seznamu števil' description = '''\

firstMinus(L1, L2): seznam L2 je enak kot L1, razen prvega elementa, ki je lahko negiran ali pa ne. Predikat naj vrne obe rešitvi, eno za drugo.

-  ?- firstMinus([1,2,3], L).
-    L = [1,2,3] ;
-    L = [-1,2,3].
+?- firstMinus([1,2,3], L).
+  L = [1,2,3] ;
+  L = [-1,2,3].
 
''' hint = {} diff --git a/prolog/problems/license_plates/genexp_2/en.py b/prolog/problems/license_plates/genexp_2/en.py index 2238f4d..9b25f12 100644 --- a/prolog/problems/license_plates/genexp_2/en.py +++ b/prolog/problems/license_plates/genexp_2/en.py @@ -6,14 +6,14 @@ slug = 'generate an arithmetic expression from a list' description = '''\

genexp(L, E): the expression E is obtained from the list L by inserting arithmetic operators between list elements. Your code should generate all valid solutions.

-  ?- genexp([1,2,3], L).
-    L = 1+2+3 ;
-    L = 1+2-3 ;
-    L = (1+2)*3 ;
-    L = (1+2)/3 ;
-    L = 1-2+3 ;
-    L = 1-2-3 ;
-    ...
+?- genexp([1,2,3], L).
+  L = 1+2+3 ;
+  L = 1+2-3 ;
+  L = (1+2)*3 ;
+  L = (1+2)/3 ;
+  L = 1-2+3 ;
+  L = 1-2-3 ;
+  …
 
''' hint = {} diff --git a/prolog/problems/license_plates/genexp_2/sl.py b/prolog/problems/license_plates/genexp_2/sl.py index 9160f27..b205a7c 100644 --- a/prolog/problems/license_plates/genexp_2/sl.py +++ b/prolog/problems/license_plates/genexp_2/sl.py @@ -6,14 +6,14 @@ slug = 'Sestavi aritmetični izraz iz številk v podanem seznamu' description = '''\

genexp(L, E): Izraz E je zgrajen iz številk v seznamu L z dodajanjem aritmetičnih operatorjev. Predikat naj vrača vse možne izraze, enega po enega.

-  ?- genexp([1,2,3], L).
-    L = 1+2+3 ;
-    L = 1+2-3 ;
-    L = (1+2)*3 ;
-    L = (1+2)/3 ;
-    L = 1-2+3 ;
-    L = 1-2-3 ;
-    ...
+?- genexp([1,2,3], L).
+  L = 1+2+3 ;
+  L = 1+2-3 ;
+  L = (1+2)*3 ;
+  L = (1+2)/3 ;
+  L = 1-2+3 ;
+  L = 1-2-3 ;
+  …
 
''' hint = {} diff --git a/prolog/problems/license_plates/getdigits_2/en.py b/prolog/problems/license_plates/getdigits_2/en.py index afc41d4..cfa66a0 100644 --- a/prolog/problems/license_plates/getdigits_2/en.py +++ b/prolog/problems/license_plates/getdigits_2/en.py @@ -6,8 +6,8 @@ slug = 'remove non-numeric elements from a list' description = '''\

getdigits(L, DL): the list DL contains the numeric elements of L, in the same order as in the original list.

-  ?- getdigits([2,3,e,-,4,b], DL).
-    DL = [2,3,4].
+?- getdigits([2,3,e,-,4,b], DL).
+  DL = [2,3,4].
 
''' hint = {} diff --git a/prolog/problems/license_plates/getdigits_2/sl.py b/prolog/problems/license_plates/getdigits_2/sl.py index 3f59e90..a67f164 100644 --- a/prolog/problems/license_plates/getdigits_2/sl.py +++ b/prolog/problems/license_plates/getdigits_2/sl.py @@ -6,8 +6,8 @@ slug = 'Vrni vse številke iz podanega seznama' description = '''\

getdigits(L, DL): seznam DL vsebuje vse številke iz seznama L, vrstni red elementov se ohrani.

-  ?- getdigits([2,3,e,-,4,b], DL).
-    DL = [2,3,4].
+?- getdigits([2,3,e,-,4,b], DL).
+  DL = [2,3,4].
 
''' hint = {} diff --git a/prolog/problems/license_plates/joindigits_2/en.py b/prolog/problems/license_plates/joindigits_2/en.py index c51f452..9dd7c00 100644 --- a/prolog/problems/license_plates/joindigits_2/en.py +++ b/prolog/problems/license_plates/joindigits_2/en.py @@ -6,11 +6,11 @@ slug = 'join adjacent numbers in a list' description = '''\

joindigits(L, NL): the list NL is obtained from L by arbitrarily joining neighboring digits. Your code should generate all valid solutions.

-  ?- joindigits([3,2,4], NL).
-    NL = [324] ;
-    NL = [32,4] ;
-    NL = [3,24] ;
-    NL = [3,2,4].
+?- joindigits([3,2,4], NL).
+  NL = [324] ;
+  NL = [32,4] ;
+  NL = [3,24] ;
+  NL = [3,2,4].
 
''' hint = {} diff --git a/prolog/problems/license_plates/joindigits_2/sl.py b/prolog/problems/license_plates/joindigits_2/sl.py index 344d849..e8c0cb7 100644 --- a/prolog/problems/license_plates/joindigits_2/sl.py +++ b/prolog/problems/license_plates/joindigits_2/sl.py @@ -6,11 +6,11 @@ slug = 'Združi sosednja števila v seznamu na vse možne načine' description = '''\

joindigits(L, NL): seznam NL dobimo iz seznama L tako, da poljubno združujemo sosednja števila. Predikat naj vrača vse možnosti, eno po eno.

-  ?- joindigits([3,2,4], NL).
-    NL = [324] ;
-    NL = [32,4] ;
-    NL = [3,24] ;
-    NL = [3,2,4].
+?- joindigits([3,2,4], NL).
+  NL = [324] ;
+  NL = [32,4] ;
+  NL = [3,24] ;
+  NL = [3,2,4].
 
''' hint = {} diff --git a/prolog/problems/lists/conc_3/en.py b/prolog/problems/lists/conc_3/en.py index 7399f7e..ba1a571 100644 --- a/prolog/problems/lists/conc_3/en.py +++ b/prolog/problems/lists/conc_3/en.py @@ -6,10 +6,10 @@ slug = 'concatenate two lists' description = '''\

conc(L1, L2, L): the list L is obtained by appending the elements of L2 to L1.

-  ?- conc([1,2], [3,4], X).
-    X = [1,2,3,4].
-  ?- conc(X, [], [1,2,3]).
-    X = [1,2,3].
+?- conc([1,2], [3,4], X).
+  X = [1,2,3,4].
+?- conc(X, [], [1,2,3]).
+  X = [1,2,3].
 
''' hint = {} diff --git a/prolog/problems/lists/conc_3/sl.py b/prolog/problems/lists/conc_3/sl.py index 15e3163..211f65c 100644 --- a/prolog/problems/lists/conc_3/sl.py +++ b/prolog/problems/lists/conc_3/sl.py @@ -6,10 +6,10 @@ slug = 'Združi dva seznama (konkatenacija)' description = '''\

conc(L1, L2, L): seznam L dobiš tako, da seznamu L1 na konec dodaš elemente seznama L2.

-  ?- conc([1,2], [3,4], X).
-    X = [1,2,3,4].
-  ?- conc(X, [], [1,2,3]).
-    X = [1,2,3].
+?- conc([1,2], [3,4], X).
+  X = [1,2,3,4].
+?- conc(X, [], [1,2,3]).
+  X = [1,2,3].
 
''' hint = {} diff --git a/prolog/problems/lists/count_3/en.py b/prolog/problems/lists/count_3/en.py index c676dea..dd13bc0 100644 --- a/prolog/problems/lists/count_3/en.py +++ b/prolog/problems/lists/count_3/en.py @@ -6,8 +6,8 @@ slug = 'find the number of occurrences of an element in list' description = '''\

count(X, L, N): N is the number of times the element X appears in the list L.

-  ?- count(1, [1,2,1,3,1], N).
-    N = 3.
+?- count(1, [1,2,1,3,1], N).
+  N = 3.
 
''' hint = {} diff --git a/prolog/problems/lists/count_3/sl.py b/prolog/problems/lists/count_3/sl.py index 15a4650..98cd6f8 100644 --- a/prolog/problems/lists/count_3/sl.py +++ b/prolog/problems/lists/count_3/sl.py @@ -6,8 +6,8 @@ slug = 'Preštej kolikokrat se element pojavi v seznamu' description = '''\

count(X, L, N): N je število kolikokrat se element X pojavi v seznamu L.

-  ?- count(1, [1,2,1,3,1], N).
-    N = 3.
+?- count(1, [1,2,1,3,1], N).
+  N = 3.
 
''' hint = {} diff --git a/prolog/problems/lists/del_3/en.py b/prolog/problems/lists/del_3/en.py index d7e38e8..42ca19f 100644 --- a/prolog/problems/lists/del_3/en.py +++ b/prolog/problems/lists/del_3/en.py @@ -6,15 +6,15 @@ slug = 'delete an element from list' description = '''\

del(X, L1, L2): the list L2 is obtained from L1 by deleting element X.

-  ?- del(1, [1,2,3], L).
-    L = [2,3].
-  ?- del(2, [1,2,3,2,5], L).
-    L = [1,3,2,5] ;
-    L = [1,2,3,5].
-  ?- del(X, [1,2,3], L).
-    X = 1, L = [2,3] ;
-    X = 2, L = [1,3] ;
-    X = 3, L = [1,2].
+?- del(1, [1,2,3], L).
+  L = [2,3].
+?- del(2, [1,2,3,2,5], L).
+  L = [1,3,2,5] ;
+  L = [1,2,3,5].
+?- del(X, [1,2,3], L).
+  X = 1, L = [2,3] ;
+  X = 2, L = [1,3] ;
+  X = 3, L = [1,2].
 
''' hint = {} diff --git a/prolog/problems/lists/del_3/sl.py b/prolog/problems/lists/del_3/sl.py index 49ab16f..3c45408 100644 --- a/prolog/problems/lists/del_3/sl.py +++ b/prolog/problems/lists/del_3/sl.py @@ -6,15 +6,15 @@ slug = 'Zbriši element iz seznama' description = '''\

del(X, L1, L2): seznam L2 dobimo iz seznama L1 tako da zbrišemo element X.

-  ?- del(1, [1,2,3], L).
-    L = [2,3].
-  ?- del(2, [1,2,3,2,5], L).
-    L = [1,3,2,5] ;
-    L = [1,2,3,5].
-  ?- del(X, [1,2,3], L).
-    X = 1, L = [2,3] ;
-    X = 2, L = [1,3] ;
-    X = 3, L = [1,2].
+?- del(1, [1,2,3], L).
+  L = [2,3].
+?- del(2, [1,2,3,2,5], L).
+  L = [1,3,2,5] ;
+  L = [1,2,3,5].
+?- del(X, [1,2,3], L).
+  X = 1, L = [2,3] ;
+  X = 2, L = [1,3] ;
+  X = 3, L = [1,2].
 
''' hint = {} diff --git a/prolog/problems/lists/divide_3/en.py b/prolog/problems/lists/divide_3/en.py index fded262..a22c8ac 100644 --- a/prolog/problems/lists/divide_3/en.py +++ b/prolog/problems/lists/divide_3/en.py @@ -6,10 +6,10 @@ slug = 'split a list into parts of roughly equal length' description = '''\

divide(L, L1, L2): the list L1 contains elements at odd positions in L, and the list L2 contains the elements at even positions in L.

-  ?- divide([a,b,c,d,e,f,g], X, Y).
-    X = [a,c,e,g], Y = [b,d,f].
-  ?- divide([a,b,c,d,e,f], X, Y).
-    X = [a,c,e], Y = [b,d,f].
+?- divide([a,b,c,d,e,f,g], X, Y).
+  X = [a,c,e,g], Y = [b,d,f].
+?- divide([a,b,c,d,e,f], X, Y).
+  X = [a,c,e], Y = [b,d,f].
 
''' hint = {} diff --git a/prolog/problems/lists/divide_3/sl.py b/prolog/problems/lists/divide_3/sl.py index ecf9a5a..308781e 100644 --- a/prolog/problems/lists/divide_3/sl.py +++ b/prolog/problems/lists/divide_3/sl.py @@ -6,10 +6,10 @@ slug = 'Razdeli dani seznam na dva podseznama (približno) enake velikosti' description = '''\

divide(L, L1, L2): seznam L1 vsebuje elemente na lihih pozicijah v seznamu L, seznam L2 pa elemente na sodih pozicijah v L.

-  ?- divide([a,b,c,d,e,f,g], X, Y).
-    X = [a,c,e,g], Y = [b,d,f].
-  ?- divide([a,b,c,d,e,f], X, Y).
-    X = [a,c,e], Y = [b,d,f].
+?- divide([a,b,c,d,e,f,g], X, Y).
+  X = [a,c,e,g], Y = [b,d,f].
+?- divide([a,b,c,d,e,f], X, Y).
+  X = [a,c,e], Y = [b,d,f].
 
''' hint = {} diff --git a/prolog/problems/lists/dup_2/en.py b/prolog/problems/lists/dup_2/en.py index c1d0c1a..b3f3f52 100644 --- a/prolog/problems/lists/dup_2/en.py +++ b/prolog/problems/lists/dup_2/en.py @@ -6,10 +6,10 @@ slug = 'duplicate the elements of a list' description = '''\

dup(L1, L2): the list L2 is obtained from L1 by duplicating every element.

-  ?- dup([1,2], X).
-    X = [1,1,2,2].
-  ?- dup([1,2,3], X).
-    X = [1,1,2,2,3,3].
+?- dup([1,2], X).
+  X = [1,1,2,2].
+?- dup([1,2,3], X).
+  X = [1,1,2,2,3,3].
 
''' hint = {} diff --git a/prolog/problems/lists/dup_2/sl.py b/prolog/problems/lists/dup_2/sl.py index fc974d8..7d8532d 100644 --- a/prolog/problems/lists/dup_2/sl.py +++ b/prolog/problems/lists/dup_2/sl.py @@ -6,10 +6,10 @@ slug = 'Podvoji vse elemente v seznamu' description = '''\

dup(L1, L2): seznam L2 dobimo iz L1 tako, da podvojimo vsak element.

-  ?- dup([1,2], X).
-    X = [1,1,2,2].
-  ?- dup([1,2,3], X).
-    X = [1,1,2,2,3,3].
+?- dup([1,2], X).
+  X = [1,1,2,2].
+?- dup([1,2,3], X).
+  X = [1,1,2,2,3,3].
 
''' hint = {} diff --git a/prolog/problems/lists/evenlen_1_+_oddlen_1/en.py b/prolog/problems/lists/evenlen_1_+_oddlen_1/en.py index 1ac7990..a01a41b 100644 --- a/prolog/problems/lists/evenlen_1_+_oddlen_1/en.py +++ b/prolog/problems/lists/evenlen_1_+_oddlen_1/en.py @@ -7,12 +7,12 @@ description = '''\

evenlen(L): the list L has an even number of elements.
oddlen(L): the list L has an odd number of elements.

-  ?- oddlen([1,2,3,4,5]).
-    true.
-  ?- oddlen([1,2,3,4]).
-    false.
-  ?- evenlen([1,2,3,4]).
-    true.
+?- oddlen([1,2,3,4,5]).
+  true.
+?- oddlen([1,2,3,4]).
+  false.
+?- evenlen([1,2,3,4]).
+  true.
 
''' hint = {} diff --git a/prolog/problems/lists/evenlen_1_+_oddlen_1/sl.py b/prolog/problems/lists/evenlen_1_+_oddlen_1/sl.py index 1959877..4ca44c2 100644 --- a/prolog/problems/lists/evenlen_1_+_oddlen_1/sl.py +++ b/prolog/problems/lists/evenlen_1_+_oddlen_1/sl.py @@ -7,12 +7,12 @@ description = '''\

evenlen(L): seznam L ima sodo število elementov.
oddlen(L): seznam L ima liho število elementov.

-  ?- oddlen([1,2,3,4,5]).
-    true.
-  ?- oddlen([1,2,3,4]).
-    false.
-  ?- evenlen([1,2,3,4]).
-    true.
+?- oddlen([1,2,3,4,5]).
+  true.
+?- oddlen([1,2,3,4]).
+  false.
+?- evenlen([1,2,3,4]).
+  true.
 
''' hint = {} diff --git a/prolog/problems/lists/insert_3/en.py b/prolog/problems/lists/insert_3/en.py index 6a3da54..c4640ab 100644 --- a/prolog/problems/lists/insert_3/en.py +++ b/prolog/problems/lists/insert_3/en.py @@ -6,10 +6,10 @@ slug = 'insert an element into list' description = '''\

insert(X, L1, L2): the list L2 is obtained from L1 by inserting the element X at arbitrary position.

-  ?- insert(1, [2,3], L).
-    L = [1,2,3] ;
-    L = [2,1,3] ;
-    L = [2,3,1].
+?- insert(1, [2,3], L).
+  L = [1,2,3] ;
+  L = [2,1,3] ;
+  L = [2,3,1].
 
''' hint = {} diff --git a/prolog/problems/lists/insert_3/sl.py b/prolog/problems/lists/insert_3/sl.py index 08ffced..7db15a6 100644 --- a/prolog/problems/lists/insert_3/sl.py +++ b/prolog/problems/lists/insert_3/sl.py @@ -6,10 +6,10 @@ slug = 'Vstavi element na poljubno mesto v seznamu' description = '''\

insert(X, L1, L2): seznam L2 dobimo iz L1 tako, da vstavimo element X na poljubno mesto. Predikat naj vrne vse možne rešitve, eno za drugo.

-  ?- insert(1, [2,3], L).
-    L = [1,2,3] ;
-    L = [2,1,3] ;
-    L = [2,3,1].
+?- insert(1, [2,3], L).
+  L = [1,2,3] ;
+  L = [2,1,3] ;
+  L = [2,3,1].
 
''' hint = {} diff --git a/prolog/problems/lists/len_2/en.py b/prolog/problems/lists/len_2/en.py index 9de0060..3ca963e 100644 --- a/prolog/problems/lists/len_2/en.py +++ b/prolog/problems/lists/len_2/en.py @@ -6,8 +6,8 @@ slug = 'find the length of a list' description = '''\

len(L, Len): Len is the length of the list L.

-  ?- len([1,2,3], Len).
-    Len = 3.
+?- len([1,2,3], Len).
+  Len = 3.
 
''' hint = {} diff --git a/prolog/problems/lists/len_2/sl.py b/prolog/problems/lists/len_2/sl.py index 5b9f05a..0e98272 100644 --- a/prolog/problems/lists/len_2/sl.py +++ b/prolog/problems/lists/len_2/sl.py @@ -6,8 +6,8 @@ slug = 'Izračunaj dolžino danega seznama' description = '''\

len(L, Len): Len je dolžina seznama L.

-  ?- len([1,2,3], Len).
-    Len = 3.
+?- len([1,2,3], Len).
+  Len = 3.
 
''' hint = {} diff --git a/prolog/problems/lists/max_2/en.py b/prolog/problems/lists/max_2/en.py index f851cd9..c4bc7e2 100644 --- a/prolog/problems/lists/max_2/en.py +++ b/prolog/problems/lists/max_2/en.py @@ -6,10 +6,10 @@ slug = 'find the largest element in list' description = '''\

max(L, Max): Max is the largest value in the list L.

-  ?- max([5,4,1,6], M).
-    M = 6.
-  ?- max([3,2,2], M).
-    M = 3.
+?- max([5,4,1,6], M).
+  M = 6.
+?- max([3,2,2], M).
+  M = 3.
 
''' hint = {} diff --git a/prolog/problems/lists/max_2/sl.py b/prolog/problems/lists/max_2/sl.py index 81c354b..7a0d07a 100644 --- a/prolog/problems/lists/max_2/sl.py +++ b/prolog/problems/lists/max_2/sl.py @@ -6,10 +6,10 @@ slug = 'Poišči največji element v danem seznamu' description = '''\

max(L, Max): Max je največji element v seznamu L.

-  ?- max([5,4,1,6], M).
-    M = 6.
-  ?- max([3,2,2], M).
-    M = 3.
+?- max([5,4,1,6], M).
+  M = 6.
+?- max([3,2,2], M).
+  M = 3.
 
''' hint = {} diff --git a/prolog/problems/lists/memb_2/en.py b/prolog/problems/lists/memb_2/en.py index 3fb20d3..2339c5d 100644 --- a/prolog/problems/lists/memb_2/en.py +++ b/prolog/problems/lists/memb_2/en.py @@ -6,12 +6,12 @@ slug = 'find elements in list' description = '''\

memb(M, L): M is an element of list L.

-  ?- memb(X, [1,2,3]).
-    X = 1 ;
-    X = 2 ;
-    X = 3.
-  ?- memb(1, [3,2,X]).
-    X = 1.
+?- memb(X, [1,2,3]).
+  X = 1 ;
+  X = 2 ;
+  X = 3.
+?- memb(1, [3,2,X]).
+  X = 1.
 
''' hint = {} diff --git a/prolog/problems/lists/memb_2/sl.py b/prolog/problems/lists/memb_2/sl.py index 540394b..382a776 100644 --- a/prolog/problems/lists/memb_2/sl.py +++ b/prolog/problems/lists/memb_2/sl.py @@ -6,12 +6,12 @@ slug = 'Preveri (poišči), če je dani element v seznamu' description = '''\

memb(E, L): E je element seznama L.

-  ?- memb(X, [1,2,3]).
-    X = 1 ;
-    X = 2 ;
-    X = 3.
-  ?- memb(1, [3,2,X]).
-    X = 1.
+?- memb(X, [1,2,3]).
+  X = 1 ;
+  X = 2 ;
+  X = 3.
+?- memb(1, [3,2,X]).
+  X = 1.
 
''' hint = {} diff --git a/prolog/problems/lists/min_2/en.py b/prolog/problems/lists/min_2/en.py index 2432be2..18f45a6 100644 --- a/prolog/problems/lists/min_2/en.py +++ b/prolog/problems/lists/min_2/en.py @@ -6,10 +6,10 @@ slug = 'find the smallest element' description = '''\

min(L, Min): Min is the smallest value in the list L.

-  ?- min([5,4,1,6], M).
-    M = 1.
-  ?- min([3,2,2], M).
-    M = 2.
+?- min([5,4,1,6], M).
+  M = 1.
+?- min([3,2,2], M).
+  M = 2.
 
''' hint = {} diff --git a/prolog/problems/lists/min_2/sl.py b/prolog/problems/lists/min_2/sl.py index 6a5964b..703a05e 100644 --- a/prolog/problems/lists/min_2/sl.py +++ b/prolog/problems/lists/min_2/sl.py @@ -6,10 +6,10 @@ slug = 'Poišči najmanjši element v danem seznamu' description = '''\

min(L, Min): Min je najmanjši element v seznamu L.

-  ?- min([5,4,1,6], M).
-    M = 1.
-  ?- min([3,2,2], M).
-    M = 2.
+?- min([5,4,1,6], M).
+  M = 1.
+?- min([3,2,2], M).
+  M = 2.
 
''' hint = {} diff --git a/prolog/problems/lists/palindrome_1/en.py b/prolog/problems/lists/palindrome_1/en.py index 7f30f8e..48ee8ac 100644 --- a/prolog/problems/lists/palindrome_1/en.py +++ b/prolog/problems/lists/palindrome_1/en.py @@ -6,10 +6,10 @@ slug = 'check if list is a palindrome' description = '''\

palindrome(L): the elements of list L are the same when read from the front or back of the list.

-  ?- palindrome([1,2,3,2,1]).
-    true.
-  ?- palindrome([1,2,3]).
-    false.
+?- palindrome([1,2,3,2,1]).
+  true.
+?- palindrome([1,2,3]).
+  false.
 
''' hint = {} diff --git a/prolog/problems/lists/palindrome_1/sl.py b/prolog/problems/lists/palindrome_1/sl.py index 04f1f59..ad67d3f 100644 --- a/prolog/problems/lists/palindrome_1/sl.py +++ b/prolog/problems/lists/palindrome_1/sl.py @@ -6,10 +6,10 @@ slug = 'Preveri, če elementi seznama tvorijo palindrom' description = '''\

palindrome(L): Elementi seznama L se preberejo v istem vrstnem redu z začetka in s konca seznama.

-  ?- palindrome([1,2,3,2,1]).
-    true.
-  ?- palindrome([1,2,3]).
-    false.
+?- palindrome([1,2,3,2,1]).
+  true.
+?- palindrome([1,2,3]).
+  false.
 
''' hint = {} diff --git a/prolog/problems/lists/permute_2/en.py b/prolog/problems/lists/permute_2/en.py index 29d287f..b5dae76 100644 --- a/prolog/problems/lists/permute_2/en.py +++ b/prolog/problems/lists/permute_2/en.py @@ -6,13 +6,13 @@ slug = 'generate permutations of a list' description = '''\

permute(L1, L2): the list L2 is a permutation of the elements of the list L1.

-  ?- permute([1,2,3], L).
-    L = [1,2,3] ;
-    L = [1,3,2] ;
-    L = [2,1,3] ;
-    L = [2,3,1] ;
-    L = [3,1,2] ;
-    L = [3,2,1].
+?- permute([1,2,3], L).
+  L = [1,2,3] ;
+  L = [1,3,2] ;
+  L = [2,1,3] ;
+  L = [2,3,1] ;
+  L = [3,1,2] ;
+  L = [3,2,1].
 
''' hint = {} diff --git a/prolog/problems/lists/permute_2/sl.py b/prolog/problems/lists/permute_2/sl.py index 2c98340..271b5d9 100644 --- a/prolog/problems/lists/permute_2/sl.py +++ b/prolog/problems/lists/permute_2/sl.py @@ -6,13 +6,13 @@ slug = 'Generiraj permutacije elementov v seznamu' description = '''\

permute(L1, L2): seznam L2 je permutacija vrstnega reda elementov v seznamu L1.

-  ?- permute([1,2,3], L).
-    L = [1,2,3] ;
-    L = [1,3,2] ;
-    L = [2,1,3] ;
-    L = [2,3,1] ;
-    L = [3,1,2] ;
-    L = [3,2,1].
+?- permute([1,2,3], L).
+  L = [1,2,3] ;
+  L = [1,3,2] ;
+  L = [2,1,3] ;
+  L = [2,3,1] ;
+  L = [3,1,2] ;
+  L = [3,2,1].
 
''' hint = {} diff --git a/prolog/problems/lists/rev_2/en.py b/prolog/problems/lists/rev_2/en.py index 7941f9e..3ae126e 100644 --- a/prolog/problems/lists/rev_2/en.py +++ b/prolog/problems/lists/rev_2/en.py @@ -6,10 +6,10 @@ slug = 'reverse a list' description = '''\

rev(L1, L2): the list L2 is obtained from L1 by reversing the order of the elements.

-  ?- rev([1,2,3], X).
-    X = [3,2,1].
-  ?- rev([], X).
-    X = [].
+?- rev([1,2,3], X).
+  X = [3,2,1].
+?- rev([], X).
+  X = [].
 
''' hint = {} diff --git a/prolog/problems/lists/rev_2/sl.py b/prolog/problems/lists/rev_2/sl.py index 95ba8b7..ab58a1c 100644 --- a/prolog/problems/lists/rev_2/sl.py +++ b/prolog/problems/lists/rev_2/sl.py @@ -6,10 +6,10 @@ slug = 'Obrni seznam' description = '''\

rev(L1, L2): seznam L2 ima elemente v obratnem vrstnem redu kot seznam L1.

-  ?- rev([1,2,3], X).
-    X = [3,2,1].
-  ?- rev([], X).
-    X = [].
+?- rev([1,2,3], X).
+  X = [3,2,1].
+?- rev([], X).
+  X = [].
 
''' hint = {} diff --git a/prolog/problems/lists/shiftleft_2/en.py b/prolog/problems/lists/shiftleft_2/en.py index a99b4a7..a8dd5f0 100644 --- a/prolog/problems/lists/shiftleft_2/en.py +++ b/prolog/problems/lists/shiftleft_2/en.py @@ -6,8 +6,8 @@ slug = 'shift a list left' description = '''\

shiftleft(L1, L2): the list L2 is obtained from L1 by shifting elements to the left by one (circular shift).

-  ?- shiftleft([1,2,3,4,5], X).
-    X = [2,3,4,5,1].
+?- shiftleft([1,2,3,4,5], X).
+  X = [2,3,4,5,1].
 
''' hint = {} diff --git a/prolog/problems/lists/shiftleft_2/sl.py b/prolog/problems/lists/shiftleft_2/sl.py index 44e726f..ae412a6 100644 --- a/prolog/problems/lists/shiftleft_2/sl.py +++ b/prolog/problems/lists/shiftleft_2/sl.py @@ -6,8 +6,8 @@ slug = 'Premakni elemente seznama za eno mesto v levo' description = '''\

shiftleft(L1, L2): elemente v seznamu L1 za eno mesto premaknemo v levo ("circular shift").

-  ?- shiftleft([1,2,3,4,5], X).
-    X = [2,3,4,5,1].
+?- shiftleft([1,2,3,4,5], X).
+  X = [2,3,4,5,1].
 
''' hint = {} diff --git a/prolog/problems/lists/shiftright_2/en.py b/prolog/problems/lists/shiftright_2/en.py index 13384b0..63e11cf 100644 --- a/prolog/problems/lists/shiftright_2/en.py +++ b/prolog/problems/lists/shiftright_2/en.py @@ -6,8 +6,8 @@ slug = 'shift a list right' description = '''\

shiftright(L1, L2): the list L2 is obtained from L1 by shifting elements to the right by one (circular shift).

-  ?- shiftright([1,2,3,4,5], X).
-    X = [5,1,2,3,4].
+?- shiftright([1,2,3,4,5], X).
+  X = [5,1,2,3,4].
 
''' hint = {} diff --git a/prolog/problems/lists/shiftright_2/sl.py b/prolog/problems/lists/shiftright_2/sl.py index 9d84510..62fca8d 100644 --- a/prolog/problems/lists/shiftright_2/sl.py +++ b/prolog/problems/lists/shiftright_2/sl.py @@ -6,8 +6,8 @@ slug = 'Premakni elemente seznama za eno mesto v desno' description = '''\

shiftright(L1, L2): elemente v seznamu L1 za eno mesto premaknemo v desno ("circular shift").

-  ?- shiftright([1,2,3,4,5], X).
-    X = [5,1,2,3,4].
+?- shiftright([1,2,3,4,5], X).
+  X = [5,1,2,3,4].
 
''' hint = {} diff --git a/prolog/problems/lists/sublist_2/en.py b/prolog/problems/lists/sublist_2/en.py index e761e19..2697d9b 100644 --- a/prolog/problems/lists/sublist_2/en.py +++ b/prolog/problems/lists/sublist_2/en.py @@ -6,14 +6,14 @@ slug = 'generate sublists of a list' description = '''\

sublist(L, SL): SL is a continuous sublist of the list L.

-  ?- sublist([1,2,3], X).
-    X = [] ;
-    X = [1] ;
-    X = [1,2] ;
-    X = [1,2,3] ;
-    X = [2] ;
-    X = [2,3] ;
-    X = [3].
+?- sublist([1,2,3], X).
+  X = [] ;
+  X = [1] ;
+  X = [1,2] ;
+  X = [1,2,3] ;
+  X = [2] ;
+  X = [2,3] ;
+  X = [3].
 
''' hint = {} diff --git a/prolog/problems/lists/sublist_2/sl.py b/prolog/problems/lists/sublist_2/sl.py index 27d9b54..cc42219 100644 --- a/prolog/problems/lists/sublist_2/sl.py +++ b/prolog/problems/lists/sublist_2/sl.py @@ -6,14 +6,14 @@ slug = 'Generiraj vse podsezname danega seznama' description = '''\

sublist(L, SL): SL je podseznam seznama L. Predikat naj vrne vse možne podsezname, enega po enega.

-  ?- sublist([1,2,3], X).
-    X = [] ;
-    X = [1] ;
-    X = [1,2] ;
-    X = [1,2,3] ;
-    X = [2] ;
-    X = [2,3] ;
-    X = [3].
+?- sublist([1,2,3], X).
+  X = [] ;
+  X = [1] ;
+  X = [1,2] ;
+  X = [1,2,3] ;
+  X = [2] ;
+  X = [2,3] ;
+  X = [3].
 
''' hint = {} diff --git a/prolog/problems/lists/sum_2/en.py b/prolog/problems/lists/sum_2/en.py index fc4cea8..b4dab45 100644 --- a/prolog/problems/lists/sum_2/en.py +++ b/prolog/problems/lists/sum_2/en.py @@ -6,8 +6,8 @@ slug = 'find the sum of all elements in list' description = '''\

sum(L, Sum): Sum is the sum of all elements in the list L.

-  ?- sum([1,2,3], Sum).
-    Sum = 6.
+?- sum([1,2,3], Sum).
+  Sum = 6.
 
''' hint = {} diff --git a/prolog/problems/lists/sum_2/sl.py b/prolog/problems/lists/sum_2/sl.py index 0e1e6d6..cc0423b 100644 --- a/prolog/problems/lists/sum_2/sl.py +++ b/prolog/problems/lists/sum_2/sl.py @@ -6,8 +6,8 @@ slug = 'Izračunaj vsoto elementov v seznamu' description = '''\

sum(L, Sum): Sum je vsota vseh elementov v seznamu L.

-  ?- sum([1,2,3], Sum).
-    Sum = 6.
+?- sum([1,2,3], Sum).
+  Sum = 6.
 
''' hint = {} diff --git a/prolog/problems/old_exams/pascal_3/en.py b/prolog/problems/old_exams/pascal_3/en.py index bd17577..8481bd6 100644 --- a/prolog/problems/old_exams/pascal_3/en.py +++ b/prolog/problems/old_exams/pascal_3/en.py @@ -1,27 +1,27 @@ # coding=utf-8 name = 'pascal/3' -slug = 'pascal's triangle' +slug = 'pascal’s triangle' description = '''\

The first five rows of the Pascal's triangle look like this:

-        1
-       1 1
-      1 2 1
-     1 3 3 1
-    1 4 6 4 1
+    1
+   1 1
+  1 2 1
+ 1 3 3 1
+1 4 6 4 1
 

Each row begins and ends with 1. Every other element can be obtained as a sum of the two values above it. Write the predicate pascal(I,J,N) that returns the J-th value in the I-th column of the Pascal's triangle. Your solution should return exactly one answer for any input (the I and J arguments start counting with 0; you can assume that 0 ≤ JI).

-  ?- pascal(0, 0, N).
-    N = 1.
-  ?- pascal(2, 1, N).
-    N = 2.
-  ?- pascal(4, 3, N).
-    N = 4.
+?- pascal(0, 0, N).
+  N = 1.
+?- pascal(2, 1, N).
+  N = 2.
+?- pascal(4, 3, N).
+  N = 4.
 
''' hint = {} diff --git a/prolog/problems/other/genlist_4/en.py b/prolog/problems/other/genlist_4/en.py index bcdcefa..4807261 100644 --- a/prolog/problems/other/genlist_4/en.py +++ b/prolog/problems/other/genlist_4/en.py @@ -6,8 +6,8 @@ slug = 'generate a list of random numbers' description = '''\

genlist(L, N, Min, Max): the list L contains N random numbers from the interval [Min,Max).

-  ?- genlist(L, 5, 10, 100).
-    L = [12,99,81,24].
+?- genlist(L, 5, 10, 100).
+  L = [12,99,81,24].
 
''' hint = {} diff --git a/prolog/problems/sets/diff_3/en.py b/prolog/problems/sets/diff_3/en.py index 47def00..3c4cc97 100644 --- a/prolog/problems/sets/diff_3/en.py +++ b/prolog/problems/sets/diff_3/en.py @@ -6,8 +6,8 @@ slug = 'find the difference of two sets' description = '''\

diff(S1, S2, D): the list D contains all elements of S1 that don't appear in S2, with no duplicates.

-  ?- diff([2,3,5,1,7,9], [3,7,4,5,6], D).
-    D = [2,1,9].
+?- diff([2,3,5,1,7,9], [3,7,4,5,6], D).
+  D = [2,1,9].
 
''' hint = {} diff --git a/prolog/problems/sets/diff_3/sl.py b/prolog/problems/sets/diff_3/sl.py index d9b89e7..9923272 100644 --- a/prolog/problems/sets/diff_3/sl.py +++ b/prolog/problems/sets/diff_3/sl.py @@ -6,8 +6,8 @@ slug = 'Poišči razliko dveh množic' description = '''\

diff(S1, S2, D): seznam D vsebuje elemente iz S1, ki niso v S2.

-  ?- diff([2,3,5,1,7,9], [3,7,4,5,6], D).
-    D = [2,1,9].
+?- diff([2,3,5,1,7,9], [3,7,4,5,6], D).
+  D = [2,1,9].
 
''' hint = {} diff --git a/prolog/problems/sets/intersect_3/en.py b/prolog/problems/sets/intersect_3/en.py index fed5e34..fefc50a 100644 --- a/prolog/problems/sets/intersect_3/en.py +++ b/prolog/problems/sets/intersect_3/en.py @@ -6,8 +6,8 @@ slug = 'find the intersection of two sets' description = '''\

intersect(S1, S2, I): the list I contains every element that appears in both S1 and S2, with no duplicates.

-  ?- intersect([1,5,6,3,4,2], [8,1,5,9,4,3], I).
-    I = [1,5,3,4].
+?- intersect([1,5,6,3,4,2], [8,1,5,9,4,3], I).
+  I = [1,5,3,4].
 
''' hint = {} diff --git a/prolog/problems/sets/intersect_3/sl.py b/prolog/problems/sets/intersect_3/sl.py index a6af2d5..ac5501b 100644 --- a/prolog/problems/sets/intersect_3/sl.py +++ b/prolog/problems/sets/intersect_3/sl.py @@ -6,8 +6,8 @@ slug = 'Poišči presek dveh množic' description = '''\

intersect(S1, S2, I): seznam I vsebuje presek elementov v S1 in S2.

-  ?- intersect([1,5,6,3,4,2], [8,1,5,9,4,3], I).
-    I = [1,5,3,4].
+?- intersect([1,5,6,3,4,2], [8,1,5,9,4,3], I).
+  I = [1,5,3,4].
 
''' hint = {} diff --git a/prolog/problems/sets/is_subset_2/en.py b/prolog/problems/sets/is_subset_2/en.py index ad4804c..00d15e6 100644 --- a/prolog/problems/sets/is_subset_2/en.py +++ b/prolog/problems/sets/is_subset_2/en.py @@ -6,10 +6,10 @@ slug = 'check if one set is a subset of another' description = '''\

is_subset(S1, S2): the set S1 is a subset of S2.

-  ?- is_subset([2,1,3,5,0], [3,2,1,4,5,9]).
-    false.
-  ?- is_subset([2,1,3,5], [3,2,1,4,5,9]).
-    true.
+?- is_subset([2,1,3,5,0], [3,2,1,4,5,9]).
+  false.
+?- is_subset([2,1,3,5], [3,2,1,4,5,9]).
+  true.
 
''' hint = {} diff --git a/prolog/problems/sets/is_subset_2/sl.py b/prolog/problems/sets/is_subset_2/sl.py index ccec5b0..4119aaf 100644 --- a/prolog/problems/sets/is_subset_2/sl.py +++ b/prolog/problems/sets/is_subset_2/sl.py @@ -6,10 +6,10 @@ slug = 'Preveri, če je prva množica podmnožica od druge' description = '''\

is_subset(S1, S2): množica S1 je podmnožica od S2.

-  ?- is_subset([2,1,3,5,0], [3,2,1,4,5,9]).
-    false.
-  ?- is_subset([2,1,3,5], [3,2,1,4,5,9]).
-    true.
+?- is_subset([2,1,3,5,0], [3,2,1,4,5,9]).
+  false.
+?- is_subset([2,1,3,5], [3,2,1,4,5,9]).
+  true.
 
''' hint = {} diff --git a/prolog/problems/sets/is_superset_2/en.py b/prolog/problems/sets/is_superset_2/en.py index 464762c..df03caf 100644 --- a/prolog/problems/sets/is_superset_2/en.py +++ b/prolog/problems/sets/is_superset_2/en.py @@ -6,10 +6,10 @@ slug = 'check if one set is a superset of the other' description = '''\

is_superset(S1, S2): the set S1 is a superset (contains all elements) of S2.

-  ?- is_superset([3,2,1,4,5,9], [2,1,3,5]).
-    true.
-  ?- is_superset([3,2,1,4,5,9], [2,1,3,5,0]).
-    false.
+?- is_superset([3,2,1,4,5,9], [2,1,3,5]).
+  true.
+?- is_superset([3,2,1,4,5,9], [2,1,3,5,0]).
+  false.
 
''' hint = {} diff --git a/prolog/problems/sets/is_superset_2/sl.py b/prolog/problems/sets/is_superset_2/sl.py index 77d0d9d..a8cc070 100644 --- a/prolog/problems/sets/is_superset_2/sl.py +++ b/prolog/problems/sets/is_superset_2/sl.py @@ -6,10 +6,10 @@ slug = 'Preveri, če je prva množica nadmnožica od druge' description = '''\

is_superset(S1, S2): množica S1 je nadmnožica (vsebuje vse elemente) od S2.

-  ?- is_superset([3,2,1,4,5,9], [2,1,3,5]).
-    true.
-  ?- is_superset([3,2,1,4,5,9], [2,1,3,5,0]).
-    false.
+?- is_superset([3,2,1,4,5,9], [2,1,3,5]).
+  true.
+?- is_superset([3,2,1,4,5,9], [2,1,3,5,0]).
+  false.
 
''' hint = {} diff --git a/prolog/problems/sets/powerset_2/en.py b/prolog/problems/sets/powerset_2/en.py index ad2fe87..dcc299c 100644 --- a/prolog/problems/sets/powerset_2/en.py +++ b/prolog/problems/sets/powerset_2/en.py @@ -6,8 +6,8 @@ slug = 'find all subsets of a set' description = '''\

powerset(Set, Powerset): the list Powerset contains all subsets of Set.

-  ?- powerset([1,2,3], L).
-    L = [[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]].
+?- powerset([1,2,3], L).
+  L = [[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]].
 
''' hint = {} diff --git a/prolog/problems/sets/powerset_2/sl.py b/prolog/problems/sets/powerset_2/sl.py index a782dee..4a092db 100644 --- a/prolog/problems/sets/powerset_2/sl.py +++ b/prolog/problems/sets/powerset_2/sl.py @@ -6,8 +6,8 @@ slug = 'Poišči potenčno množico od dane množice' description = '''\

powerset(Set, Powerset): množica Powerset vsebuje vse podmnožice od množice Set.

-  ?- powerset([1,2,3], L).
-    L = [[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]].
+?- powerset([1,2,3], L).
+  L = [[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]].
 
''' hint = {} diff --git a/prolog/problems/sets/subset_2/en.py b/prolog/problems/sets/subset_2/en.py index eb96ac0..e31b60f 100644 --- a/prolog/problems/sets/subset_2/en.py +++ b/prolog/problems/sets/subset_2/en.py @@ -6,15 +6,15 @@ slug = 'generate all subsets of a set' description = '''\

subset(Set, Subset): the set Subset is a subset of Set. This predicate should generate all valid solutions, one by one.

-  ?- subset([1,2,3], SS).
-    SS = [1,2,3] ;
-    SS = [1,2] ;
-    SS = [1,3] ;
-    SS = [1] ;
-    SS = [2,3] ;
-    SS = [2] ;
-    SS = [3] ;
-    SS = [].
+?- subset([1,2,3], SS).
+  SS = [1,2,3] ;
+  SS = [1,2] ;
+  SS = [1,3] ;
+  SS = [1] ;
+  SS = [2,3] ;
+  SS = [2] ;
+  SS = [3] ;
+  SS = [].
 
''' hint = {} diff --git a/prolog/problems/sets/subset_2/sl.py b/prolog/problems/sets/subset_2/sl.py index eae4fcf..012d132 100644 --- a/prolog/problems/sets/subset_2/sl.py +++ b/prolog/problems/sets/subset_2/sl.py @@ -6,15 +6,15 @@ slug = 'Generiraj vse podmnožice dane množice' description = '''\

subset(Set, Subset): množica Subset je podmnožica od Set. Ta predikat naj, eno po eno, generira vse veljavne podmnožice.

-  ?- subset([1,2,3], SS).
-    SS = [1,2,3] ;
-    SS = [1,2] ;
-    SS = [1,3] ;
-    SS = [1] ;
-    SS = [2,3] ;
-    SS = [2] ;
-    SS = [3] ;
-    SS = [].
+?- subset([1,2,3], SS).
+  SS = [1,2,3] ;
+  SS = [1,2] ;
+  SS = [1,3] ;
+  SS = [1] ;
+  SS = [2,3] ;
+  SS = [2] ;
+  SS = [3] ;
+  SS = [].
 
''' hint = {} diff --git a/prolog/problems/sets/union_3/en.py b/prolog/problems/sets/union_3/en.py index db6bbd9..3789e96 100644 --- a/prolog/problems/sets/union_3/en.py +++ b/prolog/problems/sets/union_3/en.py @@ -6,8 +6,8 @@ slug = 'find the union of two sets' description = '''\

union(S1, S2, U): the list U contains all elements of S1 and S2, with no duplicates.

-  ?- union([1,5,2,3], [3,4,8,2], U).
-    U = [1,5,3,4,8,2].
+?- union([1,5,2,3], [3,4,8,2], U).
+  U = [1,5,3,4,8,2].
 
''' hint = {} diff --git a/prolog/problems/sets/union_3/sl.py b/prolog/problems/sets/union_3/sl.py index 27d3088..9a19323 100644 --- a/prolog/problems/sets/union_3/sl.py +++ b/prolog/problems/sets/union_3/sl.py @@ -6,8 +6,8 @@ slug = 'Poišči unijo dveh množic' description = '''\

union(S1, S2, U): seznam U predstavlja unijo elementov v seznamih S1 in S2, duplikatov (kot se za množice spodobi) ni.

-  ?- union([1,5,2,3], [3,4,8,2], U).
-    U = [1,5,3,4,8,2].
+?- union([1,5,2,3], [3,4,8,2], U).
+  U = [1,5,3,4,8,2].
 
''' hint = {} diff --git a/prolog/problems/sorting/is_sorted_1/en.py b/prolog/problems/sorting/is_sorted_1/en.py index 3ea6572..9848df1 100644 --- a/prolog/problems/sorting/is_sorted_1/en.py +++ b/prolog/problems/sorting/is_sorted_1/en.py @@ -6,10 +6,10 @@ slug = 'check if list is sorted' description = '''\

is_sorted(L): the elements of list L are sorted in non-decreasing order.

-  ?- is_sorted([2,3,6,8,12]).
-    true.
-  ?- is_sorted([2,3,1,6,5]).
-    false.
+?- is_sorted([2,3,6,8,12]).
+  true.
+?- is_sorted([2,3,1,6,5]).
+  false.
 
''' hint = {} diff --git a/prolog/problems/sorting/is_sorted_1/sl.py b/prolog/problems/sorting/is_sorted_1/sl.py index 5d4c1c5..a1429d3 100644 --- a/prolog/problems/sorting/is_sorted_1/sl.py +++ b/prolog/problems/sorting/is_sorted_1/sl.py @@ -6,10 +6,10 @@ slug = 'Preveri, če so elementi seznama naraščajoče urejeni' description = '''\

is_sorted(L): elementi v seznamu L morajo biti urejeni v naraščajočem vrstnem redu.

-  ?- is_sorted([2,3,6,8,12]).
-    true.
-  ?- is_sorted([2,3,1,6,5]).
-    false.
+?- is_sorted([2,3,6,8,12]).
+  true.
+?- is_sorted([2,3,1,6,5]).
+  false.
 
''' hint = {} diff --git a/prolog/problems/sorting/isort_2/en.py b/prolog/problems/sorting/isort_2/en.py index 9fba6ac..0998a6d 100644 --- a/prolog/problems/sorting/isort_2/en.py +++ b/prolog/problems/sorting/isort_2/en.py @@ -6,8 +6,8 @@ slug = 'sort a list using insertion sort' description = '''\

isort(L, SL): the list SL contains the elements of L sorted in non-decreasing order. Use the predicate sins/3 to implement insertion sort.

-  ?- isort([2,3,1,5,4], L).
-    L = [1,2,3,4,5].
+?- isort([2,3,1,5,4], L).
+  L = [1,2,3,4,5].
 
''' hint = {} diff --git a/prolog/problems/sorting/isort_2/sl.py b/prolog/problems/sorting/isort_2/sl.py index 79c3239..63459c4 100644 --- a/prolog/problems/sorting/isort_2/sl.py +++ b/prolog/problems/sorting/isort_2/sl.py @@ -6,8 +6,8 @@ slug = 'Uredi seznam z uporabo urejanja z vstavljanjem' description = '''\

isort(L, SL): seznam SL vsebuje elemente iz seznama L urejene v naraščajočem vrstnem redu. Uporabi predikat sins/3 za implementacijo urejanja z vstavljanjem.

-  ?- isort([2,3,1,5,4], L).
-    L = [1,2,3,4,5].
+?- isort([2,3,1,5,4], L).
+  L = [1,2,3,4,5].
 
''' hint = {} diff --git a/prolog/problems/sorting/pivoting_4/en.py b/prolog/problems/sorting/pivoting_4/en.py index 43e4ae3..82976ba 100644 --- a/prolog/problems/sorting/pivoting_4/en.py +++ b/prolog/problems/sorting/pivoting_4/en.py @@ -6,8 +6,8 @@ slug = 'split a list according to the pivot' description = '''\

pivoting(P, L, S, G): the list S contains the elements of L smaller or equal to P, and the list G contains the elements of L greater than P. The order of elements in S and G should be the same as in L.

-  ?- pivoting(4, [1,4,5,8,6,4,2], S, G).
-    S = [1,4,4,2], G = [5,8,6].
+?- pivoting(4, [1,4,5,8,6,4,2], S, G).
+  S = [1,4,4,2], G = [5,8,6].
 
''' hint = {} diff --git a/prolog/problems/sorting/pivoting_4/sl.py b/prolog/problems/sorting/pivoting_4/sl.py index b18e112..e1aeb7a 100644 --- a/prolog/problems/sorting/pivoting_4/sl.py +++ b/prolog/problems/sorting/pivoting_4/sl.py @@ -6,8 +6,8 @@ slug = 'Razdeli seznam na dva dela glede na podani element (pivot)' description = '''\

pivoting(P, L, S, G): seznam S vsebuje elemente iz L manjše ali enake P, seznam G pa elemente iz L večje od P. Vrstni red elementov v S in G naj bo enak kot v L.

-  ?- pivoting(4, [1,4,5,8,6,4,2], S, G).
-    S = [1,4,4,2], G = [5,8,6].
+?- pivoting(4, [1,4,5,8,6,4,2], S, G).
+  S = [1,4,4,2], G = [5,8,6].
 
''' hint = {} diff --git a/prolog/problems/sorting/quick_sort_2/en.py b/prolog/problems/sorting/quick_sort_2/en.py index faf6d41..3457440 100644 --- a/prolog/problems/sorting/quick_sort_2/en.py +++ b/prolog/problems/sorting/quick_sort_2/en.py @@ -6,8 +6,8 @@ slug = 'sort a list using quicksort' description = '''\

quick_sort(L, SL): the list SL contains the elements of L sorted in non-decreasing order. Use the predicate pivoting/4 to implement quicksort.

-  ?- quick_sort([2,3,1,5,4], L).
-    L = [1,2,3,4,5].
+?- quick_sort([2,3,1,5,4], L).
+  L = [1,2,3,4,5].
 
''' hint = {} diff --git a/prolog/problems/sorting/quick_sort_2/sl.py b/prolog/problems/sorting/quick_sort_2/sl.py index 9611b46..8b6ad94 100644 --- a/prolog/problems/sorting/quick_sort_2/sl.py +++ b/prolog/problems/sorting/quick_sort_2/sl.py @@ -6,8 +6,8 @@ slug = 'Uredi seznam z algoritmom quicksort' description = '''\

quick_sort(L, SL): seznam SL vsebuje elemente iz L urejene v naraščajočem vrstnem redu. Uporabi predikat pivoting/4 za implementacijo algoritma quicksort.

-  ?- quick_sort([2,3,1,5,4], L).
-    L = [1,2,3,4,5].
+?- quick_sort([2,3,1,5,4], L).
+  L = [1,2,3,4,5].
 
''' hint = {} diff --git a/prolog/problems/sorting/sins_3/en.py b/prolog/problems/sorting/sins_3/en.py index 2d9cf98..db35da2 100644 --- a/prolog/problems/sorting/sins_3/en.py +++ b/prolog/problems/sorting/sins_3/en.py @@ -6,10 +6,10 @@ slug = 'insert an element at correct position into a sorted list' description = '''\

sins(X, SortedList, NewList): the list NewList is obtained by inserting X into SortedList at the correct position to preserve the non-decreasing order of elements.

-  ?- sins(4, [1,2,3,5], L).
-    L = [1,2,3,4,5].
-  ?- sins(3, [1,2,3,4], L).
-    L = [1,2,3,3,4].
+?- sins(4, [1,2,3,5], L).
+  L = [1,2,3,4,5].
+?- sins(3, [1,2,3,4], L).
+  L = [1,2,3,3,4].
 
''' hint = {} diff --git a/prolog/problems/sorting/sins_3/sl.py b/prolog/problems/sorting/sins_3/sl.py index 22e51b2..fe7d015 100644 --- a/prolog/problems/sorting/sins_3/sl.py +++ b/prolog/problems/sorting/sins_3/sl.py @@ -6,10 +6,10 @@ slug = 'Vstavi element na ustrezno mesto v urejen seznam' description = '''\

sins(X, SortedList, NewList): seznam NewList dobiš tako, da vstaviš element X v SortedList na ustrezno mesto tako, da ohraniš urejenost elementov.

-  ?- sins(4, [1,2,3,5], L).
-    L = [1,2,3,4,5].
-  ?- sins(3, [1,2,3,4], L).
-    L = [1,2,3,3,4].
+?- sins(4, [1,2,3,5], L).
+  L = [1,2,3,4,5].
+?- sins(3, [1,2,3,4], L).
+  L = [1,2,3,3,4].
 
''' hint = {} diff --git a/prolog/problems/sorting/slowest_sort_ever_2/en.py b/prolog/problems/sorting/slowest_sort_ever_2/en.py index e327102..689060c 100644 --- a/prolog/problems/sorting/slowest_sort_ever_2/en.py +++ b/prolog/problems/sorting/slowest_sort_ever_2/en.py @@ -6,8 +6,8 @@ slug = 'sort a list by randomly permuting elements' description = '''\

slowest_sort_ever(L, SL): the list SL contains the elements of L sorted in non-decreasing order. Average and worst case running time is O(n * n!).

-  ?- slowest_sort_ever([2,3,1,5,4], L).
-    L = [1,2,3,4,5].
+?- slowest_sort_ever([2,3,1,5,4], L).
+  L = [1,2,3,4,5].
 
''' hint = {} diff --git a/prolog/problems/sorting/slowest_sort_ever_2/sl.py b/prolog/problems/sorting/slowest_sort_ever_2/sl.py index c62582c..d6cf66b 100644 --- a/prolog/problems/sorting/slowest_sort_ever_2/sl.py +++ b/prolog/problems/sorting/slowest_sort_ever_2/sl.py @@ -6,8 +6,8 @@ slug = 'Uredi seznam elementov s pomočjo naključnih permutacij' description = '''\

slowest_sort_ever(L, SL): seznam SL vsebuje elemente seznama L v naraščajočem vrstnem redu. Časovna zahtevnost algoritma naj bo O(n * n!).

-  ?- slowest_sort_ever([2,3,1,5,4], L).
-    L = [1,2,3,4,5].
+?- slowest_sort_ever([2,3,1,5,4], L).
+  L = [1,2,3,4,5].
 
''' hint = {} diff --git a/prolog/problems/trees/deletebt_3/en.py b/prolog/problems/trees/deletebt_3/en.py index 215fced..eedab0a 100644 --- a/prolog/problems/trees/deletebt_3/en.py +++ b/prolog/problems/trees/deletebt_3/en.py @@ -6,10 +6,10 @@ slug = 'delete an element from a binary tree' description = '''\

deleteBT(X, T, NewT): the binary tree NewT is obtained from T by deleting one occurence of the element X. If X is not a leaf node, the root of one of its subtrees is moved up. Your code should generate all valid solutions.

-  ?- deleteBT(1, b(b(b(nil,4,nil),2,b(nil,6,nil)),1,b(nil,3,b(nil,5,nil))), T).
-    T = b(b(nil,4,b(nil,6,nil)),2,b(nil,3,b(nil,5,nil))) ;
-    T = b(b(b(nil,4,nil),6,nil),2,b(nil,3,b(nil,5,nil))) ;
-    T = b(b(b(nil,4,nil),2,b(nil,6,nil)),3,b(nil,5,nil)).
+?- deleteBT(1, b(b(b(nil,4,nil),2,b(nil,6,nil)),1,b(nil,3,b(nil,5,nil))), T).
+  T = b(b(nil,4,b(nil,6,nil)),2,b(nil,3,b(nil,5,nil))) ;
+  T = b(b(b(nil,4,nil),6,nil),2,b(nil,3,b(nil,5,nil))) ;
+  T = b(b(b(nil,4,nil),2,b(nil,6,nil)),3,b(nil,5,nil)).
 
''' hint = {} diff --git a/prolog/problems/trees/depthbt_2/en.py b/prolog/problems/trees/depthbt_2/en.py index 94fec48..c3f7d4c 100644 --- a/prolog/problems/trees/depthbt_2/en.py +++ b/prolog/problems/trees/depthbt_2/en.py @@ -6,8 +6,8 @@ slug = 'find the depth of a binary tree' description = '''\

depthBT(T, D): D is the depth of the binary tree T.

-  ?- depthBT(b(b(b(nil,4,nil),2,b(nil,6,nil)),1,nil), D).
-    D = 3.
+?- depthBT(b(b(b(nil,4,nil),2,b(nil,6,nil)),1,nil), D).
+  D = 3.
 
''' hint = {} diff --git a/prolog/problems/trees/insertbt_3/en.py b/prolog/problems/trees/insertbt_3/en.py index 08eb2cd..c0fa47c 100644 --- a/prolog/problems/trees/insertbt_3/en.py +++ b/prolog/problems/trees/insertbt_3/en.py @@ -6,11 +6,11 @@ slug = 'insert an element into a binary tree' description = '''\

insertBT(X, T, NewT): the binary tree NewT is obtained from T by inserting the element X at a certain position. This is the opposite of the predicate deleteBT/3. Your code should generate all valid solutions.

-  ?- insertBT(2, b(nil,1,nil), T).
-    T = b(b(nil,1,nil),2,nil) ;
-    T = b(nil,2,b(nil,1,nil)) ;
-    T = b(b(nil,2,nil),1,nil) ;
-    T = b(nil,1,b(nil,2,nil)).
+?- insertBT(2, b(nil,1,nil), T).
+  T = b(b(nil,1,nil),2,nil) ;
+  T = b(nil,2,b(nil,1,nil)) ;
+  T = b(b(nil,2,nil),1,nil) ;
+  T = b(nil,1,b(nil,2,nil)).
 
''' hint = {} diff --git a/prolog/problems/trees/maxt_2/en.py b/prolog/problems/trees/maxt_2/en.py index 20db52e..bb222f8 100644 --- a/prolog/problems/trees/maxt_2/en.py +++ b/prolog/problems/trees/maxt_2/en.py @@ -6,8 +6,8 @@ slug = 'find the greatest element in a tree' description = '''\

maxT(Tree, Max): Max is the greatest element in the tree Tree.

-  ?- maxT(t(1, t(2), t(3)), Max).
-    Max = 3.
+?- maxT(t(1, t(2), t(3)), Max).
+  Max = 3.
 
''' hint = {} diff --git a/prolog/problems/trees/memberbt_2/en.py b/prolog/problems/trees/memberbt_2/en.py index e8d48f2..1559151 100644 --- a/prolog/problems/trees/memberbt_2/en.py +++ b/prolog/problems/trees/memberbt_2/en.py @@ -6,10 +6,10 @@ slug = 'find elements in a binary tree' description = '''\

memberBT(X, T): X is an element of the binary tree T. A binary tree node is represented with the structure b(L, E, R), where L and R are left and right subtrees, respectively, and E is the node's value. An empty tree is denoted by nil.

-  ?- memberBT(X, b(b(nil,2,nil),1,b(nil,3,nil))).
-    X = 1 ;
-    X = 2 ;
-    X = 3.
+?- memberBT(X, b(b(nil,2,nil),1,b(nil,3,nil))).
+  X = 1 ;
+  X = 2 ;
+  X = 3.
 
''' hint = {} diff --git a/prolog/problems/trees/membert_2/en.py b/prolog/problems/trees/membert_2/en.py index 738d625..ef48931 100644 --- a/prolog/problems/trees/membert_2/en.py +++ b/prolog/problems/trees/membert_2/en.py @@ -6,10 +6,10 @@ slug = 'find elements in a tree' description = '''\

memberT(X, T): X is an element of the tree T. A tree node is represented with the structure t(E, T1, T2...), where E is the node's value, followed by any number of subtrees. An empty tree is denoted by nil.

-  ?- memberT(X, t(3, t(1), t(2))).
-    X = 3 ;
-    X = 1 ;
-    X = 2.
+?- memberT(X, t(3, t(1), t(2))).
+  X = 3 ;
+  X = 1 ;
+  X = 2.
 
''' hint = {} diff --git a/prolog/problems/trees/mirrorbt_2/en.py b/prolog/problems/trees/mirrorbt_2/en.py index 85c2a54..7bc622f 100644 --- a/prolog/problems/trees/mirrorbt_2/en.py +++ b/prolog/problems/trees/mirrorbt_2/en.py @@ -6,8 +6,8 @@ slug = 'flip a binary tree horizontally' description = '''\

mirrorBT(T, NewT): the binary tree NewT is obtained from T by flipping it over the vertical axis through the root node.

-  ?- mirrorBT(b(b(b(nil,4,nil),2,b(nil,5,nil)),1,b(nil,3,nil)), X).
-    X = b(b(nil,3,nil), 1, b(b(nil,5,nil), 2, b(nil,4,nil))).
+?- mirrorBT(b(b(b(nil,4,nil),2,b(nil,5,nil)),1,b(nil,3,nil)), X).
+  X = b(b(nil,3,nil), 1, b(b(nil,5,nil), 2, b(nil,4,nil))).
 
''' hint = {} diff --git a/prolog/problems/trees/numberbt_2/en.py b/prolog/problems/trees/numberbt_2/en.py index 3be193d..99dc9ca 100644 --- a/prolog/problems/trees/numberbt_2/en.py +++ b/prolog/problems/trees/numberbt_2/en.py @@ -6,8 +6,8 @@ slug = 'find the number of nodes in a binary tree' description = '''\

numberBT(T, N): N is the number of nodes in the binary tree T.

-  ?- numberBT(b(b(nil,2,nil),1,b(nil,3,nil)), N).
-    N = 3.
+?- numberBT(b(b(nil,2,nil),1,b(nil,3,nil)), N).
+  N = 3.
 
''' hint = {} diff --git a/prolog/problems/trees/tolistbt_2/en.py b/prolog/problems/trees/tolistbt_2/en.py index a6d0d4b..94ba3ea 100644 --- a/prolog/problems/trees/tolistbt_2/en.py +++ b/prolog/problems/trees/tolistbt_2/en.py @@ -6,8 +6,8 @@ slug = 'construct a list with all elements of a binary tree' description = '''\

tolistBT(T, L): the list L contains all the elements in the binary tree T, in infix order.

-  ?- tolistBT(b(b(nil,2,nil),1,b(nil,3,nil)), L).
-    L = [2,1,3].
+?- tolistBT(b(b(nil,2,nil),1,b(nil,3,nil)), L).
+  L = [2,1,3].
 
''' hint = {} -- cgit v1.2.1