diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-01-13 13:51:15 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-01-13 13:51:15 +0100 |
commit | 388b32039898cc8f1784378689007254eb7a33b6 (patch) | |
tree | ac9e4c6145ad323dc5479179a04f44bbcea73eff | |
parent | e36a8a2feca7552d236c0f6e89ac73e7e690e7b1 (diff) |
Remove space-padding from <pre> blocks
123 files changed, 489 insertions, 489 deletions
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 = '''\ <p><code>gcd(X, Y, GCD)</code>: <code>GCD</code> is the greatest common divisor of <code>X</code> and <code>Y</code>. Implement this predicate using constraints.</p> <p>Hint: try writing a predicate to find <em>all</em> common divisors of two numbers first.</p> <pre> - ?- gcd(36, 84, GCD). - GCD = 12. +?- gcd(36, 84, GCD). + GCD = 12. </pre>''' 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 = '''\ <p><code>gcd(X, Y, GCD)</code>: <code>GCD</code> je največji skupni delitelj števil <code>X</code> in <code>Y</code>. Implementiraj ta predikat z uporabo omejitev.</p> <p>Namig: poskusi najprej napisati predikat, ki poišče <em>vse</em> skupne delitelje dveh števil.</p> <pre> - ?- gcd(36, 84, GCD). - GCD = 12. +?- gcd(36, 84, GCD). + GCD = 12. </pre>''' 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 = '''\ <p><code>magic(S)</code>: the list <code>S</code> represents a 3×3 magic square (<code>S</code> 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.</p> <pre> - ?- magic(S). - S = [2, 7, 6, 9, 5, 1, 4, 3, 8] ; - … +?- magic(S). + S = [2, 7, 6, 9, 5, 1, 4, 3, 8] ; + … </pre>''' 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 = '''\ <p><code>magic(S)</code>: seznam <code>S</code> predstavlja 3×3 magični kvadrat (<code>S</code> 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.</p> <pre> - ?- magic(S). - S = [2, 7, 6, 9, 5, 1, 4, 3, 8] ; - … +?- magic(S). + S = [2, 7, 6, 9, 5, 1, 4, 3, 8] ; + … </pre>''' 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 = '''\ <p><code>tobase(Number, B, X)</code>: given a <code>Number</code> in the decimal system (base 10), <code>X</code> represents the same number in the system with base <code>B</code>. Implement this predicate using constraints. Limit the value of <code>B</code> to the interval [2..10].</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>tobase(Number, B, X)</code>: število <code>Number</code> je v desetiškem sistemu. <code>X</code> predstavlja to število v sistemu z bazo <code>B</code>. Implementiraj predikat z uporabo omejitev. Omeji vrednost <code>B</code> na interval [2..10].</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>bounding_box(Points, X1/Y1, X2/Y2)</code>: <code>X1/Y1</code> and <code>X2/Y2</code> are the bottom-left and top-right points defining the smallest bounding box containing all points in the list <code>Points</code>. <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>center(Points, R, X/Y)</code>: <code>X/Y</code> is a point in the list <code>Points</code> that is at most <code>R</code> away from all other points.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>max_sum(List, Max)</code>: <code>Max</code> is the maximal sum of two adjacent elements in <code>List</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p>A <em>mega</em>byte is the SI unit meaning 10<sup>6</sup> bytes, while a <em>mebi</em>byte is the IEC unit meaning 2<sup>20</sup> bytes. Write the predicate <code>megabytes(SI, IEC)</code> that converts between the two using constraints.</p> <pre> - ?- megabytes(2, IEC). - IEC = 1.9073486328125. - ?- megabytes(SI, 2). - SI = 2.097152. +?- megabytes(2, IEC). + IEC = 1.9073486328125. +?- megabytes(SI, 2). + SI = 2.097152. </pre>''' 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 = '''\ <p>Write a DCG with the starting symbol <code>expr</code> 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.</p> <p>Example words: <code>(1+2)*3</code>, <code>42*8*3</code>, <code>(2+1)*(3+4)</code>.</p> <pre> - ?- 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. </pre> ''' 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 = '''\ <p>Napiši gramatiko z začetnim simbolom <code>expr</code> 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.</p> <p>Primeri veljavnih besed: <code>(1+2)*3</code>, <code>42*8*3</code>, <code>(2+1)*(3+4)</code>.</p> <pre> - ?- 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. </pre> ''' 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 = '''\ <p>Write a DCG with the starting symbol <code>number</code> 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.</p> <pre> - ?- number(N, [1,2,3,4], []). - N = 1234. +?- number(N, [1,2,3,4], []). + N = 1234. </pre> ''' 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 = '''\ <p>Napiši gramatiko z začetnim simbolom <code>number</code> za jezik nenegativnih celih števil. Števila lahko vsebujejo vodilne ničle. Pomen besede v tem jeziku je kar numerična vrednost predstavljenega števila.</p> <pre> - ?- number(N, [1,2,3,4], []). - N = 1234. +?- number(N, [1,2,3,4], []). + N = 1234. </pre> ''' 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 = '''\ <p>Write a DCG with the starting symbol <code>paren</code> 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.</p> <pre> - ?- paren(D, ['(','(',')',')','(',')'], []). % (())() - D = 2. +?- paren(D, ['(','(',')',')','(',')'], []). % (())() + D = 2. </pre> ''' 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 = '''\ <p>Napiši gramatiko z začetnim simbolom <code>paren</code> za jezik pravilno gnezdenih zaporedij oklepajev. Pomen besede v tem jeziku je največja globina gnezdenja oklepajev.</p> <pre> - ?- paren(D, ['(','(',')',')','(',')'], []). % (())() - D = 2. +?- paren(D, ['(','(',')',')','(',')'], []). % (())() + D = 2. </pre> ''' 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 = '''\ <p>A DCG for mini-algol.</p> <pre> - % 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]]. </pre> ''' 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 = '''\ <p>Extend the given DCG for mini-algol to support the for-statement. Example:</p> <pre> - % 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]]. </pre> ''' 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 = '''\ <p>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:</p> <pre> - % 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]]. </pre> ''' 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 = '''\ <p>The meaning of a word (program) in this language has the form <code>In-->Out</code>, 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 <code>left</code>, <code>right</code>, <code>up</code> and <code>down</code> is to move the blank tile in the given direction.</p> <pre> - ?- 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]. </pre> <p>Helper predicates (already defined):<br /> 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 = '''\ <p>The meaning of a word (program) in this language has the form <code>In-->Out</code>, mapping from input to output lists. Besides the list contents, internal states also hold the current cursor position. The <code>left</code> and <code>right</code> instructions move the cursor one step in the given direction, while the <code>swap</code> 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).</p> <pre> - ?- 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]. </pre> <p>Helper predicate (already defined):<br /> 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 = '''\ <p><code>ancestor(X, Y)</code>: <code>X</code> is an ancestor (parent, grandparent,...) of <code>Y</code>.</p> <pre> - ?- ancestor(patricia, X). - X = john ; - X = michael ; - X = michelle. +?- ancestor(patricia, X). + X = john ; + X = michael ; + X = michelle. </pre>''' 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 = '''\ <p><code>ancestor(X, Y)</code>: <code>X</code> je prednik (oče, mama, dedek, ...) od <code>Y</code>.</p> <pre> - ?- ancestor(patricia, X). - X = john ; - X = michael ; - X = michelle. +?- ancestor(patricia, X). + X = john ; + X = michael ; + X = michelle. </pre>''' 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 = '''\ <p><code>aunt(X, Y)</code>: <code>X</code> is an aunt of <code>Y</code>.</p> <pre> - ?- aunt(sally, X). - X = vanessa ; - X = patricia. +?- aunt(sally, X). + X = vanessa ; + X = patricia. </pre>''' 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 = '''\ <p><code>aunt(X, Y)</code>: <code>X</code> je teta od <code>Y</code>.</p> <pre> - ?- aunt(sally, X). - X = vanessa ; - X = patricia. +?- aunt(sally, X). + X = vanessa ; + X = patricia. </pre>''' 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 = '''\ <p><code>brother(X, Y)</code>: <code>X</code> is a brother of <code>Y</code>.</p> <pre> - ?- brother(jeffrey, X). - X = william ; - X = sally. +?- brother(jeffrey, X). + X = william ; + X = sally. </pre>''' 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 = '''\ <p><code>brother(X, Y)</code>: <code>X</code> je brat od <code>Y</code>.</p> <pre> - ?- brother(jeffrey, X). - X = william ; - X = sally. +?- brother(jeffrey, X). + X = william ; + X = sally. </pre>''' 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 = '''\ <p><code>connected(X, Y, N)</code>: <code>X</code> and <code>Y</code> are connected with a series of (no more than <code>N</code>) parent/child relations.</p> <pre> - ?- connected(ana, morty, 10). - false. - ?- connected(ana, margaret, 10). - true. +?- connected(ana, morty, 10). + false. +?- connected(ana, margaret, 10). + true. </pre>''' 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 = '''\ <p><code>cousin(X, Y)</code>: <code>X</code> is a cousin (male or female) of <code>Y</code>.</p> <pre> - ?- cousin(andrew, X). - X = vanessa ; - X = patricia. +?- cousin(andrew, X). + X = vanessa ; + X = patricia. </pre>''' 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 = '''\ <p><code>cousin(X, Y)</code>: <code>X</code> je bratranec ali sestrična od <code>Y</code>.</p> <pre> - ?- cousin(andrew, X). - X = vanessa ; - X = patricia. +?- cousin(andrew, X). + X = vanessa ; + X = patricia. </pre>''' 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 = '''\ <p><code>descendant(X, Y)</code>: <code>X</code> is a descendant (child, grandchild,...) of <code>Y</code>.</p> <pre> - ?- descendant(patricia, X). - X = william ; - X = tina ; - X = thomas. +?- descendant(patricia, X). + X = william ; + X = tina ; + X = thomas. </pre>''' 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 = '''\ <p><code>descendant(X, Y)</code>: <code>X</code> is a descendant (child, grandchild,...) of <code>Y</code>.</p> <pre> - ?- descendant(patricia, X). - X = william ; - X = tina ; - X = thomas. +?- descendant(patricia, X). + X = william ; + X = tina ; + X = thomas. </pre>''' 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 = '''\ <p><code>father(X, Y)</code>: <code>X</code> is the father of <code>Y</code>.</p> <pre> - ?- father(thomas, william). - true. - ?- father(aleksander, X). - X = luana ; - X = daniela. +?- father(thomas, william). + true. +?- father(aleksander, X). + X = luana ; + X = daniela. </pre>''' 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 = '''\ <p><code>father(X, Y)</code>: <code>X</code> je oče od <code>Y</code>.</p> <pre> - ?- father(thomas, william). - true. - ?- father(aleksander, X). - X = luana ; - X = daniela. +?- father(thomas, william). + true. +?- father(aleksander, X). + X = luana ; + X = daniela. </pre>''' 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 = '''\ <p><code>grandparent(P, C)</code>: <code>P</code> is a grandparent of <code>C</code>.</p> <pre> - ?- grandparent(tina, X). - X = vanessa ; - X = patricia. - ?- grandparent(tina, vanessa). - true. +?- grandparent(tina, X). + X = vanessa ; + X = patricia. +?- grandparent(tina, vanessa). + true. </pre>''' 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 = '''\ <p><code>grandparent(X, Y)</code>: <code>X</code> je dedek ali babica od <code>Y</code>.</p> <pre> - ?- grandparent(tina, X). - X = vanessa ; - X = patricia. - ?- grandparent(tina, vanessa). - true. +?- grandparent(tina, X). + X = vanessa ; + X = patricia. +?- grandparent(tina, vanessa). + true. </pre>''' 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 = '''\ <p><code>mother(M, C)</code>: <code>M</code> is the mother of <code>C</code>.</p> <pre> - ?- mother(tina, william). - true. - ?- mother(nevia, X). - X = luana ; - X = daniela. +?- mother(tina, william). + true. +?- mother(nevia, X). + X = luana ; + X = daniela. </pre>''' 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 = '''\ <p><code>mother(X, Y)</code>: <code>X</code> je mama od <code>Y</code>.</p> <pre> - ?- mother(tina, william). - true. - ?- mother(nevia, X). - X = luana ; - X = daniela. +?- mother(tina, william). + true. +?- mother(nevia, X). + X = luana ; + X = daniela. </pre>''' 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 = '''\ <p><code>sister(X, Y)</code>: <code>X</code> is a sister of <code>Y</code>.</p> <pre> - ?- sister(vanessa, X). - X = patricia. +?- sister(vanessa, X). + X = patricia. </pre>''' 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 = '''\ <p><code>sister(X, Y)</code>: <code>X</code> je sestra od <code>Y</code>.</p> <pre> - ?- sister(vanessa, X). - X = patricia. +?- sister(vanessa, X). + X = patricia. </pre>''' 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 = '''\ <p><code>checkLicensePlate(LP, E1, E2)</code>: the digits in the list <code>LP</code> can be combined into a valid equation <code>E1</code> = <code>E2</code>. <code>E1</code> and <code>E2</code> are arithmetic expressions, obtained from sublists of <code>Plate</code> by inserting arithmetic operators (<code>+</code>, <code>-</code>, <code>*</code> and <code>/</code>) between elements. An additional unary minus can be inserted before the leftmost number of <code>E1</code> and <code>E2</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>checkLicensePlate(LP, E1, E2)</code>: iz cifer v seznamu <code>LP</code> se da sestaviti veljavno enačbo <code>E1</code> = <code>E2</code>. <code>E1</code> in <code>E2</code> sta aritmetična izraza, sestavljena iz podseznamov <code>Plate</code> z uporabo aritmetičnih operatorjev (<code>+</code>, <code>-</code>, <code>*</code> and <code>/</code>). Dodaten unarni minus se lahko vstavi na začetek izrazov <code>E1</code> in <code>E2</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>firstMinus(L1, L2)</code>: the list <code>L2</code> is the same as <code>L1</code>, except for the first element that may be negated. Your code should return both solutions.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>firstMinus(L1, L2)</code>: seznam <code>L2</code> je enak kot <code>L1</code>, razen prvega elementa, ki je lahko negiran ali pa ne. Predikat naj vrne obe rešitvi, eno za drugo.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>genexp(L, E)</code>: the expression <code>E</code> is obtained from the list <code>L</code> by inserting arithmetic operators between list elements. Your code should generate all valid solutions.</p> <pre> - ?- 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 ; + … </pre>''' 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 = '''\ <p><code>genexp(L, E)</code>: Izraz <code>E</code> je zgrajen iz številk v seznamu <code>L</code> z dodajanjem aritmetičnih operatorjev. Predikat naj vrača vse možne izraze, enega po enega.</p> <pre> - ?- 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 ; + … </pre>''' 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 = '''\ <p><code>getdigits(L, DL)</code>: the list <code>DL</code> contains the numeric elements of <code>L</code>, in the same order as in the original list.</p> <pre> - ?- getdigits([2,3,e,-,4,b], DL). - DL = [2,3,4]. +?- getdigits([2,3,e,-,4,b], DL). + DL = [2,3,4]. </pre>''' 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 = '''\ <p><code>getdigits(L, DL)</code>: seznam <code>DL</code> vsebuje vse številke iz seznama <code>L</code>, vrstni red elementov se ohrani.</p> <pre> - ?- getdigits([2,3,e,-,4,b], DL). - DL = [2,3,4]. +?- getdigits([2,3,e,-,4,b], DL). + DL = [2,3,4]. </pre>''' 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 = '''\ <p><code>joindigits(L, NL)</code>: the list <code>NL</code> is obtained from <code>L</code> by arbitrarily joining neighboring digits. Your code should generate all valid solutions.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>joindigits(L, NL)</code>: seznam <code>NL</code> dobimo iz seznama <code>L</code> tako, da poljubno združujemo sosednja števila. Predikat naj vrača vse možnosti, eno po eno.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>conc(L1, L2, L)</code>: the list <code>L</code> is obtained by appending the elements of <code>L2</code> to <code>L1</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>conc(L1, L2, L)</code>: seznam <code>L</code> dobiš tako, da seznamu <code>L1</code> na konec dodaš elemente seznama <code>L2</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>count(X, L, N)</code>: <code>N</code> is the number of times the element <code>X</code> appears in the list <code>L</code>.</p> <pre> - ?- count(1, [1,2,1,3,1], N). - N = 3. +?- count(1, [1,2,1,3,1], N). + N = 3. </pre>''' 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 = '''\ <p><code>count(X, L, N)</code>: <code>N</code> je število kolikokrat se element <code>X</code> pojavi v seznamu <code>L</code>.</p> <pre> - ?- count(1, [1,2,1,3,1], N). - N = 3. +?- count(1, [1,2,1,3,1], N). + N = 3. </pre>''' 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 = '''\ <p><code>del(X, L1, L2)</code>: the list <code>L2</code> is obtained from <code>L1</code> by deleting element <code>X</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>del(X, L1, L2)</code>: seznam <code>L2</code> dobimo iz seznama <code>L1</code> tako da zbrišemo element <code>X</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>divide(L, L1, L2)</code>: the list <code>L1</code> contains elements at odd positions in <code>L</code>, and the list <code>L2</code> contains the elements at even positions in <code>L</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>divide(L, L1, L2)</code>: seznam <code>L1</code> vsebuje elemente na lihih pozicijah v seznamu <code>L</code>, seznam <code>L2</code> pa elemente na sodih pozicijah v <code>L</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>dup(L1, L2)</code>: the list <code>L2</code> is obtained from <code>L1</code> by duplicating every element.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>dup(L1, L2)</code>: seznam <code>L2</code> dobimo iz <code>L1</code> tako, da podvojimo vsak element.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>evenlen(L)</code>: the list <code>L</code> has an even number of elements.<br /> <code>oddlen(L)</code>: the list <code>L</code> has an odd number of elements.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>evenlen(L)</code>: seznam <code>L</code> ima sodo število elementov.<br /> <code>oddlen(L)</code>: seznam <code>L</code> ima liho število elementov.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>insert(X, L1, L2)</code>: the list <code>L2</code> is obtained from <code>L1</code> by inserting the element <code>X</code> at arbitrary position.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>insert(X, L1, L2)</code>: seznam <code>L2</code> dobimo iz <code>L1</code> tako, da vstavimo element <code>X</code> na poljubno mesto. Predikat naj vrne vse možne rešitve, eno za drugo.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>len(L, Len)</code>: <code>Len</code> is the length of the list <code>L</code>.</p> <pre> - ?- len([1,2,3], Len). - Len = 3. +?- len([1,2,3], Len). + Len = 3. </pre>''' 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 = '''\ <p><code>len(L, Len)</code>: <code>Len</code> je dolžina seznama <code>L</code>.</p> <pre> - ?- len([1,2,3], Len). - Len = 3. +?- len([1,2,3], Len). + Len = 3. </pre>''' 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 = '''\ <p><code>max(L, Max)</code>: <code>Max</code> is the largest value in the list <code>L</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>max(L, Max)</code>: <code>Max</code> je največji element v seznamu <code>L</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>memb(M, L)</code>: <code>M</code> is an element of list <code>L</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>memb(E, L)</code>: <code>E</code> je element seznama <code>L</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>min(L, Min)</code>: <code>Min</code> is the smallest value in the list <code>L</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>min(L, Min)</code>: <code>Min</code> je najmanjši element v seznamu <code>L</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>palindrome(L)</code>: the elements of list <code>L</code> are the same when read from the front or back of the list.</p> <pre> - ?- palindrome([1,2,3,2,1]). - true. - ?- palindrome([1,2,3]). - false. +?- palindrome([1,2,3,2,1]). + true. +?- palindrome([1,2,3]). + false. </pre>''' 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 = '''\ <p><code>palindrome(L)</code>: Elementi seznama <code>L</code> se preberejo v istem vrstnem redu z začetka in s konca seznama.</p> <pre> - ?- palindrome([1,2,3,2,1]). - true. - ?- palindrome([1,2,3]). - false. +?- palindrome([1,2,3,2,1]). + true. +?- palindrome([1,2,3]). + false. </pre>''' 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 = '''\ <p><code>permute(L1, L2)</code>: the list <code>L2</code> is a permutation of the elements of the list <code>L1</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>permute(L1, L2)</code>: seznam <code>L2</code> je permutacija vrstnega reda elementov v seznamu <code>L1</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>rev(L1, L2)</code>: the list <code>L2</code> is obtained from <code>L1</code> by reversing the order of the elements.</p> <pre> - ?- rev([1,2,3], X). - X = [3,2,1]. - ?- rev([], X). - X = []. +?- rev([1,2,3], X). + X = [3,2,1]. +?- rev([], X). + X = []. </pre>''' 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 = '''\ <p><code>rev(L1, L2)</code>: seznam <code>L2</code> ima elemente v obratnem vrstnem redu kot seznam <code>L1</code>.</p> <pre> - ?- rev([1,2,3], X). - X = [3,2,1]. - ?- rev([], X). - X = []. +?- rev([1,2,3], X). + X = [3,2,1]. +?- rev([], X). + X = []. </pre>''' 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 = '''\ <p><code>shiftleft(L1, L2)</code>: the list <code>L2</code> is obtained from L1 by shifting elements to the left by one (circular shift).</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>shiftleft(L1, L2)</code>: elemente v seznamu <code>L1</code> za eno mesto premaknemo v levo ("circular shift").</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>shiftright(L1, L2)</code>: the list <code>L2</code> is obtained from L1 by shifting elements to the right by one (circular shift).</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>shiftright(L1, L2)</code>: elemente v seznamu <code>L1</code> za eno mesto premaknemo v desno ("circular shift").</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>sublist(L, SL)</code>: <code>SL</code> is a continuous sublist of the list <code>L</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>sublist(L, SL)</code>: <code>SL</code> je podseznam seznama <code>L</code>. Predikat naj vrne vse možne podsezname, enega po enega.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>sum(L, Sum)</code>: <code>Sum</code> is the sum of all elements in the list <code>L</code>.</p> <pre> - ?- sum([1,2,3], Sum). - Sum = 6. +?- sum([1,2,3], Sum). + Sum = 6. </pre>''' 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 = '''\ <p><code>sum(L, Sum)</code>: <code>Sum</code> je vsota vseh elementov v seznamu <code>L</code>.</p> <pre> - ?- sum([1,2,3], Sum). - Sum = 6. +?- sum([1,2,3], Sum). + Sum = 6. </pre>''' 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 = '''\ <p>The first five rows of the Pascal's triangle look like this:</p> <pre> - 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 </pre> <p> 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 <code>pascal(I,J,N)</code> that returns the <code>J</code>-th value in the <code>I</code>-th column of the Pascal's triangle. Your solution should return exactly one answer for any input (the <code>I</code> and <code>J</code> arguments start counting with 0; you can assume that 0 ≤ <code>J</code> ≤ <code>I</code>). <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>genlist(L, N, Min, Max)</code>: the list <code>L</code> contains <code>N</code> random numbers from the interval [<code>Min</code>,<code>Max</code>).</p> <pre> - ?- genlist(L, 5, 10, 100). - L = [12,99,81,24]. +?- genlist(L, 5, 10, 100). + L = [12,99,81,24]. </pre>''' 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 = '''\ <p><code>diff(S1, S2, D)</code>: the list <code>D</code> contains all elements of <code>S1</code> that don't appear in <code>S2</code>, with no duplicates.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>diff(S1, S2, D)</code>: seznam <code>D</code> vsebuje elemente iz <code>S1</code>, ki niso v <code>S2</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>intersect(S1, S2, I)</code>: the list <code>I</code> contains every element that appears in both <code>S1</code> and <code>S2</code>, with no duplicates.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>intersect(S1, S2, I)</code>: seznam <code>I</code> vsebuje presek elementov v <code>S1</code> in <code>S2</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>is_subset(S1, S2)</code>: the set <code>S1</code> is a subset of <code>S2</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>is_subset(S1, S2)</code>: množica <code>S1</code> je podmnožica od <code>S2</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>is_superset(S1, S2)</code>: the set <code>S1</code> is a superset (contains all elements) of <code>S2</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>is_superset(S1, S2)</code>: množica <code>S1</code> je nadmnožica (vsebuje vse elemente) od <code>S2</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>powerset(Set, Powerset)</code>: the list <code>Powerset</code> contains all subsets of <code>Set</code>.</p> <pre> - ?- 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],[]]. </pre>''' 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 = '''\ <p><code>powerset(Set, Powerset)</code>: množica <code>Powerset</code> vsebuje vse podmnožice od množice <code>Set</code>.</p> <pre> - ?- 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],[]]. </pre>''' 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 = '''\ <p><code>subset(Set, Subset)</code>: the set <code>Subset</code> is a subset of <code>Set</code>. This predicate should generate all valid solutions, one by one.</p> <pre> - ?- 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 = []. </pre>''' 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 = '''\ <p><code>subset(Set, Subset)</code>: množica <code>Subset</code> je podmnožica od <code>Set</code>. Ta predikat naj, eno po eno, generira vse veljavne podmnožice.</p> <pre> - ?- 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 = []. </pre>''' 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 = '''\ <p><code>union(S1, S2, U)</code>: the list <code>U</code> contains all elements of <code>S1</code> and <code>S2</code>, with no duplicates.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>union(S1, S2, U)</code>: seznam <code>U</code> predstavlja unijo elementov v seznamih <code>S1</code> in <code>S2</code>, duplikatov (kot se za množice spodobi) ni.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>is_sorted(L)</code>: the elements of list <code>L</code> are sorted in non-decreasing order.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>is_sorted(L)</code>: elementi v seznamu <code>L</code> morajo biti urejeni v naraščajočem vrstnem redu.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>isort(L, SL)</code>: the list <code>SL</code> contains the elements of <code>L</code> sorted in non-decreasing order. Use the predicate <code>sins/3</code> to implement insertion sort.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>isort(L, SL)</code>: seznam <code>SL</code> vsebuje elemente iz seznama <code>L</code> urejene v naraščajočem vrstnem redu. Uporabi predikat <code>sins/3</code> za implementacijo urejanja z vstavljanjem.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>pivoting(P, L, S, G)</code>: the list <code>S</code> contains the elements of <code>L</code> <em>smaller or equal to</em> <code>P</code>, and the list <code>G</code> contains the elements of <code>L</code> <em>greater than</em> <code>P</code>. The order of elements in <code>S</code> and <code>G</code> should be the same as in <code>L</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>pivoting(P, L, S, G)</code>: seznam <code>S</code> vsebuje elemente iz <code>L</code> <em>manjše ali enake</em> <code>P</code>, seznam <code>G</code> pa elemente iz <code>L</code> <em>večje od</em> <code>P</code>. Vrstni red elementov v <code>S</code> in <code>G</code> naj bo enak kot v <code>L</code>.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>quick_sort(L, SL)</code>: the list <code>SL</code> contains the elements of <code>L</code> sorted in non-decreasing order. Use the predicate <code>pivoting/4</code> to implement quicksort.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>quick_sort(L, SL)</code>: seznam <code>SL</code> vsebuje elemente iz <code>L</code> urejene v naraščajočem vrstnem redu. Uporabi predikat <code>pivoting/4</code> za implementacijo algoritma quicksort.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>sins(X, SortedList, NewList)</code>: the list <code>NewList</code> is obtained by inserting <code>X</code> into <code>SortedList</code> at the correct position to preserve the non-decreasing order of elements.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>sins(X, SortedList, NewList)</code>: seznam <code>NewList</code> dobiš tako, da vstaviš element <code>X</code> v <code>SortedList</code> na ustrezno mesto tako, da ohraniš urejenost elementov.</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>slowest_sort_ever(L, SL)</code>: the list <code>SL</code> contains the elements of <code>L</code> sorted in non-decreasing order. Average and worst case running time is O(n * n!).</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>slowest_sort_ever(L, SL)</code>: seznam <code>SL</code> vsebuje elemente seznama <code>L</code> v naraščajočem vrstnem redu. Časovna zahtevnost algoritma naj bo O(n * n!).</p> <pre> - ?- 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]. </pre>''' 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 = '''\ <p><code>deleteBT(X, T, NewT)</code>: the binary tree <code>NewT</code> is obtained from <code>T</code> by deleting one occurence of the element <code>X</code>. If <code>X</code> is not a leaf node, the root of one of its subtrees is moved up. Your code should generate all valid solutions.</p> <pre> - ?- 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)). </pre>''' 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 = '''\ <p><code>depthBT(T, D)</code>: <code>D</code> is the depth of the binary tree <code>T</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>insertBT(X, T, NewT)</code>: the binary tree <code>NewT</code> is obtained from <code>T</code> by inserting the element <code>X</code> at a certain position. This is the opposite of the predicate <code>deleteBT/3</code>. Your code should generate all valid solutions.</p> <pre> - ?- 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)). </pre>''' 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 = '''\ <p><code>maxT(Tree, Max)</code>: <code>Max</code> is the greatest element in the tree <code>Tree</code>.</p> <pre> - ?- maxT(t(1, t(2), t(3)), Max). - Max = 3. +?- maxT(t(1, t(2), t(3)), Max). + Max = 3. </pre>''' 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 = '''\ <p><code>memberBT(X, T)</code>: <code>X</code> is an element of the binary tree <code>T</code>. A binary tree node is represented with the structure <code>b(L, E, R)</code>, where <code>L</code> and <code>R</code> are left and right subtrees, respectively, and <code>E</code> is the node's value. An empty tree is denoted by <code>nil</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>memberT(X, T)</code>: <code>X</code> is an element of the tree <code>T</code>. A tree node is represented with the structure <code>t(E, T1, T2...)</code>, where <code>E</code> is the node's value, followed by any number of subtrees. An empty tree is denoted by <code>nil</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>mirrorBT(T, NewT)</code>: the binary tree <code>NewT</code> is obtained from <code>T</code> by flipping it over the vertical axis through the root node.</p> <pre> - ?- 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))). </pre>''' 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 = '''\ <p><code>numberBT(T, N)</code>: <code>N</code> is the number of nodes in the binary tree <code>T</code>.</p> <pre> - ?- 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. </pre>''' 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 = '''\ <p><code>tolistBT(T, L)</code>: the list <code>L</code> contains all the elements in the binary tree <code>T</code>, in infix order.</p> <pre> - ?- 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]. </pre>''' hint = {} |