checking boolean function inside conditional
in
Programming Questions
•
4 months ago
seems easy enough in js, can't figure out how to do it in processing. just trying to match a string in a clean way
- String word = "";
- String[] wordsToMatch = {"one", "two"};
- void setup() {}
- void draw() {}
- void keyPressed(){
- word += key;
- checkIftoClearWord();
- for(int i = 0; i < wordsToMatch.length; i++){
- if(isWordMatch()) {
- println("word detected!");
- {
- }
- }
- void checkIftoClearWord(){
- if (key == ' '){
- word = "";
- }
- }
- boolean isWordMatch(){
- String currentWord = wordsToMatch[i];
- return word.equals(currentWord){
- }
says unexpected token: void
1