PascalPons / connect4

Connect 4 Solver
GNU Affero General Public License v3.0
273 stars 50 forks source link

key3() doesn't work correctly with __int128 #29

Open selectany opened 1 year ago

selectany commented 1 year ago

To reproduce the bug you have to use Linux env. Use 8x8 boards in Position class, so position_t is of type __int128, then try to print results like that Position pos1, pos2; pos1.play("4848"); pos2.play("5151");; std::cout << "Key3 for sequence 4848: " << pos1.key3() << std::endl; std::cout << "Key3 for sequence 5151: " << pos2.key3() << std::endl;

The result is: Key3 for sequence 4848: 974 Key3 for sequence 5151: 2924