/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Random;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void arrayWord () {
"TEA",
"COFFEE",
"BOAT",
"SUN",
"SEA"
};
int idx = aleatorio.nextInt(wordgame.length);
String palavraEscolhida
= (wordgame
[idx
]);
System.
out.
println(palavraEscolhida
); System.
out.
println(scramble
(palavraEscolhida
));
}
{
// Convert your string into a simple char array:
char[] a = inputString.toCharArray();
// Scramble the letters using the standard Fisher-Yates shuffle,
for( int i=0 ; i<a.length ; i++ )
{
int j = aleatorio.nextInt(a.length);
// Swap letters
char temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
public static void main
(String[] args
){ arrayWord();
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwuUmFuZG9tOwoKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CiAgICBzdGF0aWMgUmFuZG9tIGFsZWF0b3JpbyA9IG5ldyBSYW5kb20oKTsKCQogICAgcHVibGljIHN0YXRpYyB2b2lkIGFycmF5V29yZCAoKSB7CgogICAgICAgIFN0cmluZ1tdIHdvcmRnYW1lID0gewogICAgICAgIAkiVEVBIiwKICAgICAgICAJIkNPRkZFRSIsCiAgICAgICAgCSJCT0FUIiwKICAgICAgICAJIlNVTiIsCiAgICAgICAgCSJTRUEiCiAgICAgICAgCQogICAgICAgIH07CiAgICAKICAgICAgICBpbnQgaWR4ID0gYWxlYXRvcmlvLm5leHRJbnQod29yZGdhbWUubGVuZ3RoKTsKICAgICAgICBTdHJpbmcgcGFsYXZyYUVzY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