Re: Simple math/programming challenge for the "REAL programmer" Feeb

Liste des GroupesRevenir à ol advocacy 
Sujet : Re: Simple math/programming challenge for the "REAL programmer" Feeb
De : nospam (at) *nospam* dfs.com (DFS)
Groupes : comp.os.linux.advocacy
Date : 10. Mar 2024, 20:55:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uskvmv$341fu$8@dont-email.me>
References : 1 2 3 4
User-Agent : Betterbird (Windows)
On 3/10/2024 11:59 AM, Yaxley Peaks wrote:
And got:
Error(s), warning(s):
*** - EVAL: undefined function SEQ-KEEP
 SEQ-KEEP was added in emacs 29, what version are you using?
https://www.gnu.org/software/emacs/manual/html_node/elisp/Sequence-Functions.html#index-seq_002dkeep
As I said, I submitted it here:
https://rextester.com/l/common_lisp_online_compiler
Just post the output of your lisp code.
(defun kaprekarp (n)
   (let* ((num (* n n))
          (snum (number-to-string num))
          (num-digits (length (number-to-string n)))
          (num-list (string-split snum "" t))
          (right-side (reverse (take num-digits (reverse num-list))))
          (left-side (reverse (nthcdr num-digits (reverse num-list))))
          (left-side-num (string-to-number (mapconcat 'identity left-side)))
          (right-side-num (string-to-number (mapconcat 'identity right-side))))
     (= n (+ right-side-num left-side-num))))
(defun solve-problem (low high)
   (seq-keep (lambda (x)
               (and (kaprekarp x) x))
             (number-sequence low high)))
(solve-problem 1 100000000)

Date Sujet#  Auteur
10 Mar 24 * Simple math/programming challenge for the "REAL programmer" Feeb19DFS
10 Mar 24 +* Re: Simple math/programming challenge for the "REAL programmer" Feeb17Yaxley Peaks
10 Mar 24 i`* Re: Simple math/programming challenge for the "REAL programmer" Feeb16DFS
10 Mar 24 i +- Re: Simple math/programming challenge for the "REAL programmer" Feeb1Stéphane CARPENTIER
10 Mar 24 i +* Re: Simple math/programming challenge for the "REAL programmer" Feeb12Tyrone
10 Mar 24 i i`* Re: Simple math/programming challenge for the "REAL programmer" Feeb11DFS
10 Mar 24 i i +* Re: Simple math/programming challenge for the "REAL programmer" Feeb5vallor
10 Mar 24 i i i`* Re: Simple math/programming challenge for the "REAL programmer" Feeb4DFS
10 Mar 24 i i i +* Re: Simple math/programming challenge for the "REAL programmer" Feeb2vallor
11 Mar 24 i i i i`- Re: Simple math/programming challenge for the "REAL programmer" Feeb1DFS
10 Mar 24 i i i `- Re: Simple math/programming challenge for the "REAL programmer" Feeb1vallor
10 Mar 24 i i `* Re: Simple math/programming challenge for the "REAL programmer" Feeb5DFS
11 Mar 24 i i  `* Re: Simple math/programming challenge for the "REAL programmer" Feeb4Tyrone
11 Mar 24 i i   +- Re: Simple math/programming challenge for the "REAL programmer" Feeb1DFS
11 Mar 24 i i   `* Re: Simple math/programming challenge for the "REAL programmer" Feeb2Physfitfreak
11 Mar 24 i i    `- Re: Simple math/programming challenge for the "REAL programmer" Feeb1DFS
10 Mar 24 i `* Re: Simple math/programming challenge for the "REAL programmer" Feeb2Yaxley Peaks
10 Mar 24 i  `- Re: Simple math/programming challenge for the "REAL programmer" Feeb1DFS
11 Mar 24 `- Re: Simple math/programming challenge for the "REAL programmer" Feeb1DFS

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal