Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Word Destructor
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; import java.util.function.*; class Rextester { public static final List<String[]> LETTERS = new ArrayList<String[]>(){{ add(new String[]{"sh", "sch", "ch"}); add(new String[]{"u", "uu", "uh"}); add(new String[]{"d", "t", "dt", "th", "dd"}); add(new String[]{"e", "ä", "eh"}); add(new String[]{"a", "ah", "ahhhhh"}); add(new String[]{"k", "c", "kk"}); add(new String[]{" ", "_"}); add(new String[]{"s", "ß", "ss"}); add(new String[]{"o", "ou", "oo"}); add(new String[]{"h", "'", ""}); add(new String[]{"r", "rrr"}); add(new String[]{"i", "ie", "ii", "ih"}); add(new String[]{"y", "ü"}); add(new String[]{"j", "tsch", "dsch"}); add(new String[]{"p", "b", "pp", "bb"}); }}; public static void main(String args[]) { String name = new Scanner(System.in).nextLine(); StringBuilder sb = new StringBuilder(); System.out.println(name); for(String c : name.split("")){ sb.append(getEquivalent(c)); } System.out.println(sb.toString()); } public static String getEquivalent(String s){ for(String[] sa : LETTERS){ if(Arrays.asList(sa).contains(s.toLowerCase())){ return sa[(int)(Math.random() * sa.length)]; } } return s; } }
run
|
edit
|
history
|
help
0
Duplicate in string
Two Sum in Sorted input array
Split
Sort an array of 0's 1's 2's
Three In A Row Solver
Relation
Iterative Merge sort
classwork
classwork
currency.java