'How to make combinations between all items of 2 lists in NetLogo 6.2?
I have the following doubt: I have two lists with three values each and I would like to make combinations between the items in these 2 lists.
For example: list1 [5 10 15] and list2 [2 4 8]. I would like to have the following combinations:
list3 [[5 2] [10 2] [15 2] [5 4] [10 4] [15 4] [5 8] [10 8] [15 8]]
I was only able to do the following combination:
let list1 ( list repro1 repro2 repro3 ) ;; input variable in the interface. repro1 = 5; repro2 = 10 and repro3 = 15
let list2 ( list met1 met2 met3 ) ;; input variable in the interface. met1 = 2; met2 = 4 and met3 = 8
let list3 ( map [ [ l1 l2 ] -> ( list l1 l2 ) ] list1 list2 )
print list3 ;; command center: [[5 2] [10 4] [15 8]]
Can anybody help me?
Thanks in advance
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
