name = 'prog_listswap/2' slug = 'list-manipulation language' description = '''\
Write a DCG for manipulating list elements. The first symbol in every word is
[begin]
, followed by any sequence of "instruction" symbols from
the set {left
, right
, swap
}, and finally
the symbol [end]
. The starting symbol should be named
prog_listswap
.
This exercise has already been solved for you. Check how it works in the console.
Example words: [begin,right,swap,end]
, [begin,right,right,swap,left,swap,end]
.