aboutsummaryrefslogtreecommitdiff
path: root/model.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'model.lisp')
-rw-r--r--model.lisp14
1 files changed, 14 insertions, 0 deletions
diff --git a/model.lisp b/model.lisp
index d17d130..ccbaa9a 100644
--- a/model.lisp
+++ b/model.lisp
@@ -118,3 +118,17 @@
(->> cardset
(mapcar #'card->str)
(format nil "~{~a~^, ~}")))
+
+(fn make-joker (&optional (rank :ACE)) (-> (&optional rank) card)
+ (cons rank :Joker))
+
+(fn make-deck (&optional (n 1)) (-> (&optional fixnum) cardset)
+ (append
+ (loop :for i :from 1 :to n
+ :nconc (loop :for j :from 1 :to 52
+ collect (int->card (1- j))))
+ (loop :for i :from 1 :to n
+ :collect (->> i
+ 1-
+ int->rank
+ make-joker))))