From 8e179857d82572cd0406c94d526de4d25e381c06 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Sun, 24 Jan 2021 03:13:08 +0900 Subject: Define *aces* and *faces* constant. --- blackjack.lisp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/blackjack.lisp b/blackjack.lisp index a8f818e..83c9c5c 100644 --- a/blackjack.lisp +++ b/blackjack.lisp @@ -1,12 +1,13 @@ +(defconst *aces* '(A)) +(defconst *faces* '(J Q K)) + (defun acep (x) (declare (xargs :guard t)) - (eq x 'A)) + (and (member x *aces*) t)) (defun facep (x) (declare (xargs :guard t)) - (case x - ((J Q K) t) - (t nil))) + (and (member x *faces*) t)) (defun rankp (x) (declare (xargs :guard t)) -- cgit v1.2.3