tests dir added

This commit is contained in:
2021-02-17 00:09:41 +01:00
parent 4b93f39375
commit c909415847
6 changed files with 348 additions and 126 deletions

View File

@@ -40,3 +40,24 @@
; from list of lists creates csv string
; (print (make-csv '(("r1c1" "r1c2") ("r2c1" "r2c2"))))
(defun make-csv (csv_list)
(do
(define rows_str "")
(define r 0)
(for row csv_list
(define cols_str "")
(define c 0)
(for col row
(if (= c 0)
(define cols_str col)
(define cols_str (+ cols_str "," (display col))))
(define c (inc c)))
(if (= r 0)
(define rows_str cols_str)
(define rows_str (+ rows_str "\n" cols_str)))
(define r (inc r)))
rows_str
))