summaryrefslogtreecommitdiff
path: root/prolog/problems/lists/dup_2/en.py
blob: d6aef717b1f9ddaf32e5c7179e538533e9b8922a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
id = 110
name = 'dup/2'
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].
</pre>'''

hint = {}