summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2021-04-17 23:18:03 -0600
committerLogan Hunt <loganhunt@simponic.xyz>2021-04-17 23:18:03 -0600
commitb66ae29fe10e4251137a043acea075cbc34f8531 (patch)
treef652829f279a9357043b42d3d02138f22f9f5a36
downloadlispruns-b66ae29fe10e4251137a043acea075cbc34f8531.tar.gz
lispruns-b66ae29fe10e4251137a043acea075cbc34f8531.zip
Bruh
-rw-r--r--main.lisp52
1 files changed, 52 insertions, 0 deletions
diff --git a/main.lisp b/main.lisp
new file mode 100644
index 0000000..7414396
--- /dev/null
+++ b/main.lisp
@@ -0,0 +1,52 @@
+(ql:quickload "cl-charms")
+(ql:quickload "trivial-left-pad")
+
+(defvar *splits* '(("Kraid" 0 0 0)("Phantoon" 0 0 0)("Draygon" 0 0 0) ("Ridley" 0 0 0)))
+
+(defun make-string-bruh () "bruh")
+
+(defun add-to-string-if-not-empty (string suffix)
+ (cond ((not (zerop (length string))) (concatenate 'string string suffix))))
+
+(defun number->two-wide (num)
+ (cond ((not (zerop num)) (format nil "~2,'0D" num)) (t "")))
+
+(defun millis->strings (millis)
+ (let*
+ ((hours (/ millis (* 1000 60 60)))
+ (minutes (mod (/ millis (* 1000 60)) 60))
+ (seconds (mod (/ millis 1000) 60))
+ (centis (mod millis 100)))
+ (list
+ (number->two-wide (floor hours))
+ (number->two-wide (floor minutes))
+ (format nil "~2,'0d" (floor seconds))
+ (format nil "~2,'0d" (floor centis)))))
+
+(defun time->string (time_strs)
+ (concatenate 'string
+ (add-to-string-if-not-empty (car time_strs) ":")
+ (add-to-string-if-not-empty (cadr time_strs) ":")
+ (add-to-string-if-not-empty (caddr time_strs) ".")
+ (cadddr time_strs)))
+
+(defun format-my-split (split)
+ (cond
+ ((null split) "")
+ (t (concatenate 'string (trivial-left-pad:left-pad (car split) 15) (format-my-split (cdr split))))))
+
+(defun hello-world ()
+ (charms:with-curses ()
+ (charms:disable-echoing)
+ (charms:enable-raw-input)
+ (loop named hello-world
+ with window = (charms:make-window 50 15 10 10)
+ do (progn
+ (charms:clear-window window)
+ (charms:write-string-at-point window (make-string-bruh) 0 0)
+ (charms:refresh-window window)
+
+ ;; Process input
+ (when (eql (charms:get-char window) #\q)
+ (return-from hello-world))
+ (sleep 0.1)))))