melron Posted December 28, 2016 Share Posted December 28, 2016 (edited) Hello guys! Im trying to find the best way to split 3 Vectors... example: public static Vector<L2PcInstance> players = new Vector<>(); Contains 50 players. I want to split them to 25 - 25 but not taking 1 by 1 .. i want randomly selection in the next 2 vectors public static Vector<L2PcInstance> vec1 = new Vector<>(); public static Vector<L2PcInstance> vec2 = new Vector<>(); Im always missing something and the result isnt correct. Someone can help me? Thank you!!! Edited December 28, 2016 by melron Link to comment Share on other sites More sharing options...
0 melron Posted December 28, 2016 Author Share Posted December 28, 2016 (edited) Collections.shuffle(list) then use list.subList(. I personally use list.subList for all paging systems. Yea i found it thank you guys! :-* Edited December 28, 2016 by melron Link to comment Share on other sites More sharing options...
0 AccessDenied Posted December 28, 2016 Share Posted December 28, 2016 Yea i found it thank you guys! :-* Don't send kisses on tryskell, it turn him on and we all know what happen when a french wannabe programmer who need 9 months for 1 revision gets on :* :-[ :-[ :-[ Link to comment Share on other sites More sharing options...
0 Tryskell Posted December 28, 2016 Share Posted December 28, 2016 Don't send kisses on tryskell, it turn him on and we all know what happen when a french wannabe programmer who need 9 months for 1 revision gets on :* :-[ :-[ :-[ You're jealous. Link to comment Share on other sites More sharing options...
0 SweeTs Posted December 28, 2016 Share Posted December 28, 2016 Lockerinho. Link to comment Share on other sites More sharing options...
Question
melron
Hello guys!
Im trying to find the best way to split 3 Vectors...
example:
Contains 50 players.
I want to split them to 25 - 25 but not taking 1 by 1 .. i want randomly selection in the next 2 vectors
Im always missing something and the result isnt correct. Someone can help me?
Thank you!!!
Edited by melronLink to comment
Share on other sites
19 answers to this question
Recommended Posts