How to make a simple list out of a list of list?

23 views
Skip to first unread message

Iara Vilela

unread,
Apr 3, 2024, 3:09:05 PMApr 3
to netlogo-users
Hi,
Is there a way to make a simple list of numbers, say [1 2 3] , from a list of list like [[1 2][3]]?
I'd like to get all the values of the inner lists in a single list. Is it possible? If so, how?
Thanks for any help
Iara

Christopher Ruebeck

unread,
Apr 3, 2024, 3:34:40 PMApr 3
to netlogo-users
Hi Iara,

Here’s something that addresses exactly what you described, though it may not be general enough for your needs. Still, this example gives you some hints for developing a more robust solution.

observer> show reduce sentence [[1 2][3]]
observer: [1 2 3]

Chris

--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/61965a8a-0144-4c9d-ab20-e9751ab91536n%40googlegroups.com.

Iara Vilela

unread,
Apr 5, 2024, 9:28:09 AMApr 5
to Christopher Ruebeck, netlogo-users
Thank you very much. That's exactly what I need ! It solves my problem😃👍

Iara Vilela

unread,
Apr 5, 2024, 9:28:12 AMApr 5
to Christopher Ruebeck, netlogo-users

😃

Iara Vilela reagiu pelo Gmail

Iara Vilela

unread,
Apr 5, 2024, 9:28:15 AMApr 5
to Christopher Ruebeck, netlogo-users

Iara Vilela

20:56 (há 1 minuto)



para netlogo-users, Christopher
Thank you very much. That's exactly what I need ! It solves my problem😃👍
Em qua., 3 de abr. de 2024 às 16:34, Christopher Ruebeck <rueb...@lafayette.edu> escreveu:
Reply all
Reply to author
Forward
0 new messages