how to get the order of each item in a list?

30 views
Skip to first unread message

Mandy Dong

unread,
Apr 26, 2020, 11:23:06 AM4/26/20
to netlogo-users
I want to sort t list, eg:[1 6 7 2 3 8] and get the order of each of this item (-> [0 3 4 1 2 5])
How can I achieve this by netlogo?

p.s I am in a great hurry to finish my homework. If you know the solution, please contact me as soon as possible!

Aaron Andre Brandes

unread,
Apr 27, 2020, 6:11:42 PM4/27/20
to Mandy Dong, netlogo-users

Hi Mandy,

sort [ 1 6 7 2 3 8]

 

When you are trying to find a procedure, try looking at the

NetLogo Dictionary

 

Searching for “sort” would take you to a link for the command.

 

Aaron

 

-- 

Aaron Brandes, Software Developer

Center for Connected Learning and Computer-Based Modeling

--
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/2569fa13-39a1-4d61-b00a-f4388b9ad8af%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages