Function: decipher-insert-frequency-counts

decipher-insert-frequency-counts is a byte-compiled function defined in decipher.el.gz.

Signature

(decipher-insert-frequency-counts FREQ-LIST TOTAL)

Documentation

Insert frequency counts in current buffer.

Each element of FREQ-LIST is a list (LETTER FREQ ...). TOTAL is the total number of letters in the ciphertext.

Source Code

;; Defined in /usr/src/emacs/lisp/play/decipher.el.gz
;;--------------------------------------------------------------------
;; Perform the analysis:
;;--------------------------------------------------------------------

(defun decipher-insert-frequency-counts (freq-list total)
  "Insert frequency counts in current buffer.
Each element of FREQ-LIST is a list (LETTER FREQ ...).
TOTAL is the total number of letters in the ciphertext."
  (let ((i 4) temp-list)
    (while (> i 0)
      (setq temp-list freq-list)
      (while temp-list
        (insert (caar temp-list)
                (format "%4d%3d%%  "
                        (cadar temp-list)
                        (floor (* 100.0 (cadar temp-list)) total)))
        (setq temp-list (nthcdr 4 temp-list)))
      (insert ?\n)
      (setq freq-list (cdr freq-list)
            i         (1- i)))))