3 ms·
Pretty neat stuff. Looks like the move generator is missing a few features like underpromotion but it is very concise. I wrote a rudimentary engine + move gener
by vishvananda 12y ago
Pretty neat stuff. Looks like the move generator is missing a few features like underpromotion but it is very concise. I wrote a rudimentary engine + move generator[1] using bitboards[2] a couple of years ago. Unfortunately python poorly suited for bitmath optimizations because it doesn't support fixed width integers. Once I saw how slow my movegen went compared to a c version, I gave up on finishing up the minimax search to complete the engine. It does run quite a bit faster in pypy but still no easy way to force 64 bit integers.
[1] https://github.com/vishvananda/ivory https://github.com/vishvananda/ivory
[2] https://chessprogramming.wikispaces.com/Bitboards https://chessprogramming.wikispaces.com/Bitboards
- ris 12y agoCython? Numba?
- halfcat 12y agoThe problem with Cython, in this case, is that in order to get close to C/C++ speed, you end up having to write code that looks an awful lot like C/C++. All of the Python black magic that let's you write this in 111 lines goes away.
- fijal 12y agoYou can either use numpy ints in pypy (I think they're nicely optimized) or there is __pypy__.intop module that does something. Come to #pypy on freenode we'll sort you out ;-)