Skip to content

Instantly share code, notes, and snippets.

@DarkArc
Created August 5, 2014 23:29
Show Gist options
  • Save DarkArc/d71a8cb5819dcbef0423 to your computer and use it in GitHub Desktop.
Save DarkArc/d71a8cb5819dcbef0423 to your computer and use it in GitHub Desktop.
Loony words
public static char loonyCharacter() {
switch (ChanceUtil.getRandom(7)) {
case 7:
return '?';
case 6:
return '&';
case 5:
return '!';
case 4:
return '#';
case 3:
return '@';
case 2:
return '%';
default:
return '$';
}
}
public static ChatColor loonyColor() {
switch (ChanceUtil.getRandom(6)) {
case 6:
return ChatColor.RED;
case 5:
return ChatColor.GREEN;
case 4:
return ChatColor.BLUE;
case 3:
return ChatColor.AQUA;
case 2:
return ChatColor.YELLOW;
case 1:
return ChatColor.DARK_PURPLE;
default:
return ChatColor.WHITE;
}
}
public String loonizeWord(String word) {
return loonizeWord(word, true);
}
public String loonizeWord(String word, boolean useColor) {
String loonyFilteredString = "";
if (useColor) {
for (int f = 0; f < word.length(); f++) {
loonyFilteredString = loonyFilteredString + ChatUtil.loonyColor() + ChatUtil.loonyCharacter();
}
} else {
for (int f = 0; f < word.length(); f++) {
loonyFilteredString = loonyFilteredString + ChatUtil.loonyCharacter();
}
}
return loonyFilteredString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment