davidoss 552 Posted August 19, 2018 Is there any function or command to iterate this array: [["launch_NLAW_F","arifle_MX_F","arifle_MX_SW_F","Laserdesignator"],[1,2,1,1]] to this array [["launch_NLAW_F",1],["arifle_MX_F",2],["arifle_MX_SW_F",1],["Laserdesignator",1]] I can not invent anything Wise Share this post Link to post Share on other sites
jts_2009 96 Posted August 19, 2018 8 minutes ago, davidoss said: I can not invent anything Wise array1 = [["launch_NLAW_F",1],["arifle_MX_F",2],["arifle_MX_SW_F",3],["Laserdesignator",2]] Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted August 19, 2018 17 minutes ago, davidoss said: Is there any function or command to change this array: [["launch_NLAW_F","arifle_MX_F","arifle_MX_SW_F","Laserdesignator"],[1,2,1,1]] to this array [["launch_NLAW_F",1],["arifle_MX_F",2],["arifle_MX_SW_F",3],["Laserdesignator",2]] I can not invent anything Wise Try this: _array = [["launch_NLAW_F","arifle_MX_F","arifle_MX_SW_F","Laserdesignator"],[1,2,1,1]]; _array params ["_keys","_values"]; _merged = _keys apply {[_x,(_values select (_keys find _x))]}; //prints: [["launch_NLAW_F",1],["arifle_MX_F",2],["arifle_MX_SW_F",1],["Laserdesignator",1]] Cheers 4 1 Share this post Link to post Share on other sites
gc8 981 Posted August 19, 2018 _arr = [["launch_NLAW_F","arifle_MX_F","arifle_MX_SW_F","Laserdesignator"],[1,2,1,1]]; _arr1 = _arr select 0; _arr2 = _arr select 1; _res = []; { _res pushBack [_x,_arr2 select _forEachIndex]; } forEach _arr1; sleep 0.1; player sideChat (str _res); 2 1 Share this post Link to post Share on other sites
Harzach 2518 Posted August 19, 2018 I came up with essentially the same thing as @gc8, but damn that's beautiful, @Grumpy Old Man! 1 Share this post Link to post Share on other sites
davidoss 552 Posted August 19, 2018 Yea @Grumpy Old Man is like Maestro with his Masterpieces 1 Share this post Link to post Share on other sites