lundi 18 mai 2015

Setting multiple integers for "If" statement test value

I am trying to set multiple integer tests for a single variable in the if statement. The logical operators won't work due to the fact that they must be boolean.

For example:

if self.nodeAtPoint(location) == self.fake {

    groundspeed = 35.0

self.button1value++

if(button1value == 2) {
  groundspeed = 5.0}

if(button1value == 4){
  groundspeed = 5.0}

if(button1value == 6) {
  groundspeed = 5.0}
}

The goal is to be able to put all of the even numbers shown into just one if -statement. Thanks.

Aucun commentaire:

Enregistrer un commentaire