Variables in coding

3 posts / 0 new
Last post
Offline
Last seen: 1 year 6 months ago
Joined: 06/13/2015 - 20:06
Gems: 0
Variables in coding

How can you use an if statement or change an Logic variable in a custom code?

My code for now

if(bbq = true) {
    bbq = false
}

if(bbq = false) {
    bbq = true
}

This totally don't work. Please help?



Offline
Last seen: 2 years 2 months ago
Joined: 07/01/2015 - 04:09
Gems: 0
I'm really wandering how to

I'm really wandering how to use this codes I don't know almost nothing. But my java knolege say that you have made two mistakes:

You should use == for logic tests instead or = (used for attribution).

You should finish comands with ";"

So try this:

if(bbq == true) {
    bbq = false;
}

if(bbq == false) {
    bbq = true;
}

 

Offline
Last seen: 1 year 6 months ago
Joined: 06/13/2015 - 20:06
Gems: 0
Thanks! It works

Thanks! It works