Sha256: 57593050c9e41e6dd271ccd8128f5daa6e4a49ee61e9f141a65b406537dd9765

Contents?: true

Size: 448 Bytes

Versions: 395

Compression:

Stored size: 448 Bytes

Contents

;;; nucleotide-count.el --- nucleotide-count Exercise (exercism)

;;; Commentary:

;;; Code:


(defun nucleotide-count (sequence)
  (let ((counts (copy-alist '((?A . 0) (?C . 0) (?G . 0) (?T . 0)))))
    (dolist (i (append sequence nil))
      (let ((n (assoc i counts)))
        (if n
            (setcdr n (1+ (cdr n)))
          (error "Invalid nucleotide '%c'" i))))
    counts))


(provide 'nucleotide-count)
;;; nucleotide-count.el ends here

Version data entries

395 entries across 395 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.179 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.178 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.177 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.176 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.175 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.174 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.173 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.172 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.171 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.170 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.169 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.167 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.166 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.165 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.164 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.163 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.162 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.161 tracks/elisp/exercises/nucleotide-count/example.el
trackler-2.2.1.160 tracks/elisp/exercises/nucleotide-count/example.el