2012-02-02から1日間の記事一覧

Problem 11

(require 'cl) (defun make-ad-lst (pivot len grid-size) (let* ((idx (1- len)) (right (loop for i from 0 to idx collect i)) (down (loop for i from 0 to idx collect (* grid-size i))) (right-down (loop for i from 0 to idx collect (+ (* grid-si…

Problem 10

(require 'calc-ext) (defvar calc-command-flags nil) (defun find-factor (num) (catch 'found (let ((i 2)) (while (math-lessp (math-sub i 1) (math-floor (math-sqrt num))) (if (math-equal (math-mod num i) 0) (throw 'found i) (setq i (math-add …

Problem 12

(require 'cl) (require 'calc-ext) (defvar calc-command-flags nil) (defun find-factor (num) (catch 'found (let ((i 2)) (while (math-lessp (math-sub i 1) (math-floor (math-sqrt num))) (if (math-equal (math-mod num i) 0) (throw 'found i) (set…