jeudi 2 avril 2015

Lisp Get the firt list and not dotted number

I have declared a variable like follows and add it to LIST



'( ((1 1 0 0 0 1 0 1 1 1) . 0) ) )


I have a random function which should return a random item but I only want it to be the first part (1 1 0 0 0 1 0 1 1 1), I don't want it returning (. 0). How can I do this, my function is below



(defun random ()
(nth (random (length LIST)) LIST) )




Aucun commentaire:

Enregistrer un commentaire