Google Colab 上で to_bitboard() メソッドを使って bitboard を取得すると [[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]] になる
Closed this issue · 1 comments
ishidakei commented
生成直後の Board() から to_bitboard() メソッドで bitboard を取得すると [[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]] になります。
コード
import creversi
import numpy as np
board = creversi.Board()
print(board)
bitboard = np.empty(1, creversi.dtypeBitboard)
board.to_bitboard(bitboard)
print(bitboard)
board.set_bitboard(bitboard, creversi.BLACK_TURN)
print(board)
実行結果
|abcdefgh
-+--------
1|........
2|........
3|........
4|...ox...
5|...xo...
6|........
7|........
8|........
[[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]]
|abcdefgh
-+--------
1|........
2|........
3|........
4|........
5|........
6|........
7|........
8|........
creversi.h を修正すると正しく動いているようです。
https://colab.research.google.com/drive/1bMulWuOYfThypgJYRALS9WCJyyZVb1-a
TadaoYamaoka commented
ご指摘ありがとうございます。修正しました。