summaryrefslogtreecommitdiff
path: root/lang/prolog/1.8.7/src/permute
blob: 54f8feefae0e5105744bce758f383807b581c957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
permute ([], []). 
permute ([E|X], Z):- 
        permute (X, Y), insert (E, Y, Z). 
insert  (E, X, [E|X]). 
insert  (E, [F|X], [F|Y]):- 
        insert (E, X, Y). 
marquise(RESULT):- 
  permute (["beautiful marquise", 
                "your beautiful eyes", 
                  "make me", 
                    "die", 
                      "of love" 
                        ], 
                          RESULT).