aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-07-10 14:12:56 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-07-10 14:12:56 +0100
commit5b05f2323c948b294d5ca793870b0d32eb235abc (patch)
treefd0170ec686043e4ae9ddfbf7d13c7aeede2f05a
parentb8b541efbc36ff2d18b03f878b12342947963ce2 (diff)
downloadalgorithms-5b05f2323c948b294d5ca793870b0d32eb235abc.tar.gz
algorithms-5b05f2323c948b294d5ca793870b0d32eb235abc.tar.bz2
algorithms-5b05f2323c948b294d5ca793870b0d32eb235abc.zip
(bsearch)+Elisp script to generate random values in bsearch.txt
Generates *LIST-SIZE* number of random numbers (within bounds 0, *UPPER-BOUND*) and inserts them one by one into bsearch.txt. Each number is separated by a newline.
-rw-r--r--bsearch-gen.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/bsearch-gen.el b/bsearch-gen.el
new file mode 100644
index 0000000..79aac56
--- /dev/null
+++ b/bsearch-gen.el
@@ -0,0 +1,9 @@
+(defconst *LIST-SIZE* 128)
+(defconst *UPPER-BOUND* 1024)
+(with-current-buffer (find-file "bsearch.txt")
+ (mapcar
+ #'(lambda (res) (insert (format "%s\n" res)))
+ (cl-loop
+ for i from 0 to *LIST-SIZE*
+ collect
+ (random *UPPER-BOUND*))))