From 39730c70367bcaa96e34982b90268d2170c75e90 Mon Sep 17 00:00:00 2001 From: El-BG-1970 Date: Thu, 28 Jul 2022 22:01:43 +0200 Subject: added some checks to commodities and inventory to pass tests --- src/commodities.lisp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/commodities.lisp') diff --git a/src/commodities.lisp b/src/commodities.lisp index 474fe7d..1302a98 100644 --- a/src/commodities.lisp +++ b/src/commodities.lisp @@ -13,6 +13,7 @@ :accessor price))) (defun new-commodity (name price) - (make-instance 'commodity - :name name - :price price)) + (when (> price 0) + (make-instance 'commodity + :name name + :price price))) -- cgit v1.2.3