return int void error

WHY pls help me :( iam very said

void setup(){
  println(getTileID("grass"));
}

int getTileID(String name) {
  int id = 0;
 if (name.equals("stone")) {
     id = 41;
  } else if (name.equals("grass")) {
     id = 10;
  } else if (name.equals("wood")) {
     id = 23;
  } else {
    id = 0;
  }
  return id;
}
Tagged:

Answers

Sign In or Register to comment.