Changeable words: Difference between revisions

Content deleted Content added
Wherrera (talk | contribs)
m Minor edit to Java code
Line 622: Line 622:
}
}
}
}
System.out.println(String.format("Changeable words in %s:", fileName));
System.out.printf("Changeable words in %s:\n", fileName);
int n = 1;
int n = 1;
for (String word1 : dictionary) {
for (String word1 : dictionary) {
for (String word2 : dictionary) {
for (String word2 : dictionary) {
if (word1 != word2 && hammingDistance(word1, word2) == 1)
if (word1 != word2 && hammingDistance(word1, word2) == 1)
System.out.println(String.format("%2d: %-14s -> %s", n++, word1, word2));
System.out.printf("%2d: %-14s -> %s\n", n++, word1, word2);
}
}
}
}