Anonymous user
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 {
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);
|