コード例 #1
0
ファイル: test_bitboard.py プロジェクト: parsaeian/othello-ai
def test_shift_nw():
    mask = 0x0000001000000000
    assert bb.shift(mask, 'nw') == 0x0000200000000000
    assert bb.shift(mask, 'nw', times=2) == 0x0040000000000000
コード例 #2
0
ファイル: test_bitboard.py プロジェクト: parsaeian/othello-ai
def test_shift_oob():
    assert bb.shift(0x80000000c0000000, 'w', times=20) == 0
    assert bb.shift(0x0000000000a00001, 'e', times=20) == 0
    assert bb.shift(0x1000000000000000, 'n', times=20) == 0
    assert bb.shift(0x0000000030000001, 's', times=20) == 0
コード例 #3
0
ファイル: test_bitboard.py プロジェクト: parsaeian/othello-ai
def test_shift_se():
    mask = 0x0000001000000000
    assert bb.shift(mask, 'se') == 0x0000000008000000
    assert bb.shift(mask, 'se', times=2) == 0x0000000000040000
コード例 #4
0
ファイル: test_bitboard.py プロジェクト: parsaeian/othello-ai
def test_shift_s():
    mask = 0x0000001000000000
    assert bb.shift(mask, 's') == 0x0000000010000000
    assert bb.shift(mask, 's', times=2) == 0x0000000000100000
コード例 #5
0
ファイル: test_bitboard.py プロジェクト: parsaeian/othello-ai
def test_shift_n():
    mask = 0x0000800000000000
    assert bb.shift(mask, 'n') == 0x0080000000000000
    assert bb.shift(mask, 'n', times=2) == 0x8000000000000000
コード例 #6
0
def test_shift_oob():
    assert bb.shift(0x80000000C0000000, "w", times=20) == 0
    assert bb.shift(0x0000000000A00001, "e", times=20) == 0
    assert bb.shift(0x1000000000000000, "n", times=20) == 0
    assert bb.shift(0x0000000030000001, "s", times=20) == 0
コード例 #7
0
def test_shift_nw():
    mask = 0x0000001000000000
    assert bb.shift(mask, "nw") == 0x0000200000000000
    assert bb.shift(mask, "nw", times=2) == 0x0040000000000000
コード例 #8
0
def test_shift_s():
    mask = 0x0000001000000000
    assert bb.shift(mask, "s") == 0x0000000010000000
    assert bb.shift(mask, "s", times=2) == 0x0000000000100000
コード例 #9
0
def test_shift_se():
    mask = 0x0000001000000000
    assert bb.shift(mask, "se") == 0x0000000008000000
    assert bb.shift(mask, "se", times=2) == 0x0000000000040000