Hy evry one i need your help for a class room project

Yes, need ==s there.
Or this:

switch (state) {
case 0:
//code
break;
case 1:
//code
break;
case 2:
//code
break;
}

Then you're not going thru 3 comparisons very time, just jumping right to the correct one.