From 0f492e382348a77f4ccf3e8bd62b9fd10aa83110 Mon Sep 17 00:00:00 2001 From: nik gaffney Date: Sat, 9 Jan 2021 14:03:04 +0100 Subject: [PATCH] =?UTF-8?q?=E4=B7=B4=20Development?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On the mountain, a tree --- i-ching.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/i-ching.el b/i-ching.el index ef8ebc2..60fbf54 100644 --- a/i-ching.el +++ b/i-ching.el @@ -507,12 +507,12 @@ c.f. ‘The Superior man’ (Legge, Wilhem), ‘Noble young one’ (Hatcher), 't (nth 1 (alist-get number hexagrams)))) (defun i-ching-number-to-judgment (number) - "Present an interpretation of Hexagram NUMBER." + "Present an interpretation (judgment) of Hexagram NUMBER." (let ((hexagrams i-ching-hexagram-summary)) (nth 2 (alist-get number hexagrams)))) (defun i-ching-number-to-image (number) - "Present an interpretation of Hexagram NUMBER." + "Present an interpretation (image) of Hexagram NUMBER." (let ((hexagrams i-ching-hexagram-summary)) (nth 3 (alist-get number hexagrams)))) @@ -521,6 +521,11 @@ c.f. ‘The Superior man’ (Legge, Wilhem), ‘Noble young one’ (Hatcher), 't (let ((hexagrams i-ching-hexagram-summary)) (nth 4 (alist-get number hexagrams)))) +(defun i-ching-number-to-name (number) + "The name of Hexagram NUMBER based on it's unicode name." + (let* ((hexagrams i-ching-hexagram-summary) + (unicode-name (nth 4 (alist-get number hexagrams)))) + (capitalize (seq-drop unicode-name 13)))) (defun i-ching-describe-hexagram (point mark) "Show the name of a HEXAGRAM (between POINT and MARK) based on it's unicode name." @@ -558,6 +563,7 @@ see: `i-ching-divination-method' & `i-ching-randomness-source' for details." ;; the casting method should return a hexagram (or changing hexagram) ('3-coins #'i-ching--three-coins) ('yarrow-stalks #'i-ching--yarrow-stalks) + ('6-bit #'i-ching--random-number) ('4-coins (message "unimplemented")) ('bagua (message "unimplemented")) ('cheezburger (message "LOL"))