Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Magic Bitboards: Finding all valid bishop moves in a 64-bit multiply (2008).
// return whether newboard includes a win final boolean haswon(long newboard) { long y = newboard & (newboard>>HEIGHT); if ((y & (y >> 2*HEIGHT)) != 0) // check diagonal \ return true; y = newboard & (newboard>>H1); if ((y & (y >> 2*H1)) != 0) // check horizontal - return true; y = newboard & (newboard>>H2); // check diagonal / if ((y & (y >> 2*H2)) != 0) return true; y = newboard & (newboard>>1); // check vertical | return (y & (y >> 2)) != 0; }
[1] http://tromp.github.io/c4/Connect4.java
[2] https://github.com/denkspuren/BitboardC4/blob/master/Bitboar...
There are no comments on this comment yet.
[1] http://tromp.github.io/c4/Connect4.java
[2] https://github.com/denkspuren/BitboardC4/blob/master/Bitboar...