Last active
January 10, 2020 12:36
-
-
Save ff6347/be6175dcb509ce87872b0e0fd52f82d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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