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

hint = {}