I'm looking to create a basic chess (or failing that, checkers/draughts) engine. After researching the topic I'm fairly confident that I want to use a series of bitboards. I understand the concept at a basic level but I'm having trouble representing them in Java.
I've attempted to represent the white pieces of a chessboard as 1 and everything else as 0 using a long:
long whitePieces = 0000000000000000000000000000000000000000000000001111111111111111L;
But when I print it out I get the following 46 bits:
System.out.println(Long.toBinaryString(whitePieces));
1001001001001001001001001001001001001001001001
What is causing this result? I'm sure there's something I'm fundamentally misunderstanding here; If anyone could point me in the right direction I'd be very grateful.