summaryrefslogtreecommitdiff
path: root/prolog/problems/lists/divide_3/en.py
blob: 657b0134be09c73b3362bce73acd81e935a55e1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# coding=utf-8

id = 115
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 = {}