help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Too many permutations computed


From: Emanuel Berg
Subject: Re: Too many permutations computed
Date: Wed, 02 Aug 2023 12:13:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

uzibalqa wrote:

>         (while (< j h) [...]
>           (setq j (1+ j)))
>         [...]
>         for i := 0; i < k-1; i += 1 do [...]

You can replace that `while' with a for loop using `cl-loop'
and for, to make it a closer match to the pseudo-code.

This: (setq j (1+ j)) can be replaced by `cl-incf' as in
(cl-incf j) - but better yet is to get away with that and use
a for loop to iterate instead.

Again you can check out these two

  https://dataswamp.org/~incal/emacs-init/perm.el
  https://www.emacswiki.org/emacs/StringPermutations

but after spending so much time on your own solution I get it
you want to complete it ...

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]