Java Program Using Bitwise Operators Javascript Snakes