private String applyDrunkEffect(String text,int amount){
  amount=Math.max(amount / 2 + 1,amount * (20 + text.length()) / 40);
  StringBuilder b=new StringBuilder(text);
  while (amount > 1) {
switch (Rand.rand(3)) {
case 0:
      swapLetters(b);
    break;
case 1:
  removeLetter(b);
break;
case 2:
duplicateLetter(b);
}
amount--;
}
b.append(" *hicks*");
return b.toString();
}

private String applyDrunkEffect ( String text , int amount ) { amount = Math . max ( amount / 2 + 1 , amount * ( 20 + text . length ( ) ) / 40 ) ; StringBuilder b = new StringBuilder ( text ) ; while ( amount > 1 ) { switch ( Rand . rand ( 3 ) ) { case 0 : swapLetters ( b ) ; break ; case 1 : removeLetter ( b ) ; break ; case 2 : duplicateLetter ( b ) ; } amount -- ; } b . append ( " *hicks*" ) ; return b . toString ( ) ; }
apply random mutating effects to the text for slurry drunken speech .
