Skip to content

Instantly share code, notes, and snippets.

@hitherejoe hitherejoe/Map.java Secret
Created Apr 2, 2017

Embed
What would you like to do?
public List<String> mapFromWords(String... words) {
List<String> braille = new ArrayList<>();
for (int i = 0; i < words.length; i++) {
braille.addAll(mapFromString(words[i]));
if (i < words.length - 1) braille.add(Braille.SPACE.getValue());
}
return braille;
}
public List<String> mapFromString(String text) {
List<String> braille = new ArrayList<>();
for (int i = 0; i < text.length(); i++) {
braille.add(Braille.fromKey(
Character.toLowerCase(text.charAt(i))).getValue());
}
return braille;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.