I'm trying to take a list of lists of lists (don't worry, I'll put an example) and convert the elements of each last least into one. This is what I've done so far:
(defun cost(state)
(let ((list_elements '()))
(dolist (element state)
(dolist (subElement element)
(setq list_elements (append list_elements (list subElement))))
finally (return list_elements))))
Example:
(list
(list
(list
(list 1 9 't121)
(list 1 10 't122))
(list
(list 2 10 't123)
(list 2 11 't124)))
(list
(list
(list 1 9 't121)
(list 1 11 't132))
(list
(list 2 11 't133)
(list 2 12 't134))))
So, this is supposed to return
((1 9 T121) (1 10 T122) (2 10 T123) (2 11 T124) (1 9 T121) (1 11 T132) (1 11 T132) (2 11 T133) (2 12 T134))
And it is only returning ((1 9 T121) (1 11 T132))
After that, I'm supposed to count the number of different elements in the list.
Does anyone see what the problem is in this function?