diff options
author | Thanos Apollo <[email protected]> | 2023-12-28 04:06:35 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-28 04:06:35 +0200 |
commit | 62a42174cbbb796f7d8bfa4df12ef844d35a6a72 (patch) | |
tree | 3aad1c82102e62f175241fb91d5cb4d237e673b8 /gnosis-dev.el | |
parent | be7bc38c44267bcd7ac4d8d1e41cc87c8cef516a (diff) |
Add gnosis-dev-tags & random-items func
Diffstat (limited to 'gnosis-dev.el')
-rw-r--r-- | gnosis-dev.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gnosis-dev.el b/gnosis-dev.el index 57e3ddc..2457300 100644 --- a/gnosis-dev.el +++ b/gnosis-dev.el @@ -5,6 +5,21 @@ (require 'gnosis) +(defvar gnosis-dev-tags '("anatomy" "thoracic" "serratus-anterior" + "biochemistry" "informatics" "amino-acids" + "microbiology" "gram-positive" "gram-negative" + "fungi" "parasites")) + +(defun gnosis-dev-random-items (list x) + "Select X random items from LIST." + (let ((shuffled-list (copy-sequence list)) + selected-items) + (dotimes (_ x) + (let* ((index (random (length shuffled-list))) + (item (nth index shuffled-list))) + (setq selected-items (cons item selected-items)) + (setq shuffled-list (append (butlast shuffled-list index) (nthcdr (1+ index) shuffled-list))))) + selected-items)) (defun gnosis-dev-test () "Start testing env." (interactive) |