This is my attempt to translate from the functional OCaml version, focusing on elegancy. If you like to, please help me optimize it while retaining elegancy :) https://github.com/phuc/Score4-haskell/blob/master/Main.hs
C++: sh -c "time ./bin.release/score4 o53 y43 -debug" Depth 7, placing on 0, score:2 Depth 7, placing on 1, score:8 Depth 7, placing on 2, score:8 Depth 7, placing on 3, score:8 Depth 7, placing on 4, score:8 Depth 7, placing on 5, score:8 Depth 7, placing on 6, score:2 5
Your Haskell code:
sh -c "time ./score4.bin o53 y43 -debug" Depth 7, placing on 0, score 0 Depth 7, placing on 1, score 8 Depth 7, placing on 2, score 8 Depth 7, placing on 3, score 8 Depth 7, placing on 4, score 8 Depth 7, placing on 5, score 8 Depth 7, placing on 6, score 0 5
I'll try to see why your code miscalculates on the two borders, but I don't speak Haskell so don't expect much :-)