Hi guys,
I have this database of houses, Im trying to make a method so when the user types the housename in like (house1) then the list of everything within it will return. can anyone help please?
Heres the lisp code:
(defun get-house (housename)
but iv tried lots of different stuff but cant get it to work, please help!
I have this database of houses, Im trying to make a method so when the user types the housename in like (house1) then the list of everything within it will return. can anyone help please?
Heres the lisp code:
(setf *house-db
'(
;; first house
((name house1)
(type terrace)
(rooms ((kitchen ((dimensions (20 12))(appliances (cooker))))
(bathroom ((dimensions (10 14))(features (bath toilet))))
(bedrooms ((bedroom1 ((dimensions (15 21))(features (double-bed ))))))))
(garden (pond lawn shed)))
;;
((name house2)
(type terrace)
(rooms ((kitchen ((dimensions (2 1))(appliances (dishwasher))))
(bathroom ((dimensions (11 12))(features (toilet))))
(bedrooms ((bedroom1 ((dimensions (8 20))(features (chandelier))))
(bedroom2 ((dimensions (8 20))(features (chandelier))))
(bedroom3 ((dimensions (8 20))(features (chandelier))))
(bedroom4 ((dimensions (15 21))(features (double-bed washbasin))))))))
(garden (shed)))
))
i want to return this when the user types in 'house1' for example:
((name house1)
(type terrace)
(rooms ((kitchen ((dimensions (20 12))(appliances (cooker))))
(bathroom ((dimensions (10 14))(features (bath toilet))))
(bedrooms ((bedroom1 ((dimensions (15 21))(features (double-bed ))))))))
(garden (pond lawn shed)))
so iv started with the method heading(defun get-house (housename)
but iv tried lots of different stuff but cant get it to work, please help!