Add simple multiplication table function
This commit is contained in:
parent
d8eb322ca7
commit
0dc3fe0410
1 changed files with 10 additions and 0 deletions
|
@ -752,6 +752,16 @@ If no direction is given, don't split."
|
|||
(define-key yas-minor-mode-map [(tab)] nil)
|
||||
(define-key yas-minor-mode-map (kbd "C-\\") 'yas-expand))
|
||||
|
||||
(defun multiplication-table (number &optional upto)
|
||||
""
|
||||
(interactive "nMultiplication table for: \nP")
|
||||
(let ((upto (or upto 10))
|
||||
(buffer (get-buffer-create "*Multiplication*")))
|
||||
(with-current-buffer buffer
|
||||
(erase-buffer)
|
||||
(cl-loop for i from 1 to upto do (insert (format "%5d: %d\n" i (* number i)))))
|
||||
(pop-to-buffer buffer)))
|
||||
|
||||
;;;; Tests
|
||||
|
||||
(stante-after ert
|
||||
|
|
Loading…
Reference in a new issue