diff options
author | Aleš Smodiš <aless@guru.si> | 2015-08-18 16:06:19 +0200 |
---|---|---|
committer | Aleš Smodiš <aless@guru.si> | 2015-08-18 16:06:19 +0200 |
commit | 95e2fe57f6e4639f6ae9f1fef368829d5090dbf6 (patch) | |
tree | 462ba05eb0c4732ca1c97739548801258bf47b40 /prolog/problems/lists/conc_3 |
Exported all problems from the SQLite database into the new directory structure.
Diffstat (limited to 'prolog/problems/lists/conc_3')
-rw-r--r-- | prolog/problems/lists/conc_3/common.py | 11 | ||||
-rw-r--r-- | prolog/problems/lists/conc_3/en.py | 14 |
2 files changed, 25 insertions, 0 deletions
diff --git a/prolog/problems/lists/conc_3/common.py b/prolog/problems/lists/conc_3/common.py new file mode 100644 index 0000000..29a3919 --- /dev/null +++ b/prolog/problems/lists/conc_3/common.py @@ -0,0 +1,11 @@ +id = 104 +group = 'lists' +number = 12 +visible = True +facts = None + +solution = '''\ +conc([], L, L). +conc([H|T], L2, [H|L]) :- + conc(T, L2, L). +''' diff --git a/prolog/problems/lists/conc_3/en.py b/prolog/problems/lists/conc_3/en.py new file mode 100644 index 0000000..3e127c0 --- /dev/null +++ b/prolog/problems/lists/conc_3/en.py @@ -0,0 +1,14 @@ +id = 104 +name = 'conc/3' +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]. +</pre>''' + +hint = {} |