Or operand with int in if statement

前端 未结 12 1940
傲寒
傲寒 2021-01-25 07:45

My problem is that program is not reading codes as i intended \"he\" would.

I have

if (hero.getPos() == (6 | 11 | 16)) {
    move = new Object[] {\"Up\",         


        
12条回答
  •  北海茫月
    2021-01-25 08:16

    using the answer from:

    How can I test if an array contains a certain value?

    you could create an array of numbers and check if your ci.getNumber() is in it.

提交回复
热议问题