Jump to content
  • 0

Best Way For Randomly Split


melron

Question

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 by melron
Link to comment
Share on other sites

Recommended Posts

  • 0

Collections.shuffle(list) then use list.subList(.

 

I personally use list.subList for all paging systems.

Yea i found it thank you guys! :-*

Edited by melron
Link to comment
Share on other sites

  • 0

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

  • 0

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

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock