[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Computations on indices
From: |
Heime |
Subject: |
Computations on indices |
Date: |
Fri, 28 Jul 2023 19:07:09 +0000 |
How can I use 'k-1' in the following function ?
(defun permutor (k word)
"Generate all permutations of WORD."
(let ( (wlis '())
;; (c (make-vector n 0))
(i 0) )
(if (<= k 1)
(add-to-list 'wlis word)
(while (< i k)
(permutor k-1 word)
(if (evenp i)
(add-to-list 'wlis (protilus-cswap word i k-1))
(add-to-list 'wlis (protilus-cswap word 0 k-1)))
(setq i (1+ i))) )))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Computations on indices,
Heime <=