Skip to content

Instantly share code, notes, and snippets.

@ff6347
Last active January 10, 2020 12:36
Show Gist options
  • Save ff6347/be6175dcb509ce87872b0e0fd52f82d7 to your computer and use it in GitHub Desktop.
Save ff6347/be6175dcb509ce87872b0e0fd52f82d7 to your computer and use it in GitHub Desktop.
String str = "BBBBBhuhuhuhuhuhssdsdf";
void setup() {
for(int i = 0; i < str.length();i++){
println(lookUpChar(str.charAt(i)));
}
//char foo = 'a';
//String baz = "a";
}
void draw() {
}
float lookUpChar (char c) {
String source = "abBdefghijklmnopqrstuvwxyzABCD";
float result = 0;
for (int i = 0; i< source.length(); i++) {
if (c == source.charAt(i)) {
result = map(i, 0, source.length(), 0, 180);
break;
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment