diff options
| author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-03-01 20:10:07 +0000 | 
|---|---|---|
| committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-03-02 01:17:56 +0000 | 
| commit | 5f4bfd77bdbf8bb7db6509a60baf584d0a97cdbf (patch) | |
| tree | 88f42491c0c63748b33b4d97007a175544f99367 | |
| parent | 93790fad8847632654d6220a6a71bfbf4c867775 (diff) | |
| download | cantedraw-5f4bfd77bdbf8bb7db6509a60baf584d0a97cdbf.tar.gz cantedraw-5f4bfd77bdbf8bb7db6509a60baf584d0a97cdbf.tar.bz2 cantedraw-5f4bfd77bdbf8bb7db6509a60baf584d0a97cdbf.zip  | |
Fix some issues in main
| -rw-r--r-- | src/main.lisp | 11 | 
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.lisp b/src/main.lisp index 8b8aabb..d8985d0 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -51,16 +51,16 @@  (fn read-until-valid-integers () (-> nil list)    (let ((inp (remove-duplicates (read-integers))))      (while (not (and (every #'is-valid-hand-index inp) -                     (< (length inp) 5) +                     (<= (length inp) 5)                       (>= (length inp) 0)))        (format t "Need at most 5 integers between 0 and 4...~%")        (force-output)        (setq inp (remove-duplicates (read-integers))))      inp)) -(fn read-and-confirm-valid-integers (hand) (-> nil list) +(fn read-and-confirm-valid-integers (hand) (-> (cardset) list)    (let ((confirm nil) -        inp) +        (inp nil))      (while (null confirm)        (setq inp (read-until-valid-integers))        (if (null inp) @@ -69,7 +69,7 @@                       :collect (nth index hand))                 cardset->str                 (format t "To redeal: ~a~%"))) -      (setq confirm (y-or-n-p "Confirm: "))) +      (setq confirm (y-or-n-p "Confirm:")))      inp))  (defun print-hand (hand) @@ -99,6 +99,7 @@             (read-redeal-print nil))      (format t "Cards remaining: {~a} -Final hand: [~a]" +Final hand: [~a] +"              (cardset->str rest)              (cardset->str final-hand))))  | 
