[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Program problem
From: |
Manuel Giraud |
Subject: |
Re: Program problem |
Date: |
Wed, 29 Nov 2023 16:00:29 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Lewis Creary via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:
> (It has been suggested to me by someone on the above mailing list
> thatthe following content would be appropriate for this list.)
Hi,
First things first, if you want some help you should make your code
readable to others. It may be your mail client that does that but your
text code is completely messed up:
[...]
> (defun fill-rows (row-nums change-strings pzl-form) "This fn takes as
> arguments a list of row indices, a list of an equal number, s, of
> 9-digit strings, and a puzzle form (i.e, an sexp of the form:
> ((n n n n n n n n n) (n n n n n n n n n)
> (n n n n n n n n n) (n n n n n n n n
> n) (n n n n n n n n n) (n n n n n
> n n n n) (n n n n n n n n n) (n n
> n n n n n n n) (n n n n n n n n n)), where n is a
> number between 0 and 9). The fn returns as value t he result of
> filling in row m of the argument puzzle form with numbers specified
> by the mth 9-digit string." (let* ((row-index 0)
> (row-num-index 0) (row-str (nth row-index change-strings))
> (row-num (nth row-num-index row-nums)) (change-nums
> nil) (str-pos 0) ) (while (and (< row-index (length
> row-nums)) (< str-pos 9)) ;; (comment) cycle through the
> change-strings (while (< str-pos 9) ;; cycle
> through row-str, contributing to change-list (setq
> change-nums (append change-nums
> (list (string-to-number
> (substring row-str str-pos (1+ str-pos)) )) )
> row-str (nth row-index change-strings) )
> (setcar (car (nthcdr row-num pzl-form))
> (nth str-pos change-nums) ) (cl-incf str-pos) )
> (cl-incf row-index) (cl-incf row-num-index) ) pzl-form ) )
--
Manuel Giraud