Jump to content

Best shuffle: Difference between revisions

m
→‎{{header|Java}}: make random field global
m (string conversion removal (C++))
m (→‎{{header|Java}}: make random field global)
Line 1,643:
 
public class BestShuffle {
private final static Random rand = new Random();
 
public static void main(String[] args) {
Line 1,669 ⟶ 1,670:
 
public static void shuffle(char[] text) {
Random rand = new Random();
for (int i = text.length - 1; i > 0; i--) {
int r = rand.nextInt(i + 1);
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.